Best uikit questions in March 2012

Compiling against 5.1 SDK forces new UIPopoverController "slide in" presentation of popovers -- how to disable?

10 votes

Compiling my iPad app against the 5.1 SDK (release version) causes UIPopoverController to show itself using the new "slide in" from the left presentation. This completely breaks my popover presentation, which relied on having a "black" style header and a certain height. I've tried setting presentsWithGesture to NO, but that only seems to disable the swipe gesture, and doesn't stop the presentation style.

This same app, without being recompiled, but running on iOS 5.1, uses the old popover presentation style. So I know iOS 5.1 still supports the backwards-compatible method. How can I choose to activate the old presentation of the popover?

This is really critical to my app, unfortunately.

Failing that, is there any way to get the "black" style header on the new popovers?


Although I have a UISplitViewController in my app, it is not responsible for showing the popover. Instead, I'm using this code:

   [self.popoverController presentPopoverFromRect:ipadButtonMenu.frame
                                           inView:self.view
                         permittedArrowDirections:UIPopoverArrowDirectionUp
                                         animated:YES];

This question is a cross-post from the Apple Developer Forums here. I'm hoping somebody has the answer.


Expected presentation: enter image description here

Presentation after compiling under iOS 5.1 SDK: enter image description here

This change seems poorly thought out. Sure guys, we break anything in the detail view that uses a swipe. Awesome!

To answer your 'bring back the black' question, if it's merely a question of the top navbar color, you could use the appearance proxy. For example:

[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];

The appearance proxy can be set very specifically if necessary; it has a containers model. There's a very good WWDC video on it.

With respect to just reverting to the old behavior with the new compiler, frankly, I'd love to know as well. The new behavior also breaks action sheets in the master view; previously, when the master view was presented in a popover, they'd do the right thing. Now, it's an assertion failure.

iOS: Creating tip / help popups

7 votes

Are there any built in, open source, or tutorials for creating a reusable easy to use popup for use with in game-help.

Essentially I would like to, on first run of a game, show popup tips / help that "point to" various on screen objects to help a user orient themselves with the game.

Update: Here is an example of how I ultimately want it to look / behave although I don't need it that generic but as close as possible would be good

Essentially what you need is a custom view.

You cannot use Apple's UIAlertView since its purpose is very different from what you are looking for.

I don't know what are your specific needs, but you may use a simple UILabel:

CGRect ref = objectToAddress.frame;

UILabel *tip = [[UILabel alloc] initWithFrame:CGRectMake(ref.x+ref.width, 
                                                         ref.y+ref.height,
                                                         width,
                                                         height)];

[tip setText:messageToShow];

[self.view addSubview:tip];
[tip release];

where width and height are the dimensions of the tip you want to show and messageToShow is the message you want to display.
You can, of course, customize your UILabel as you like, changing font or background color. Check the reference for additional informations.

EDIT:

You may take a look at a possible popover implementation for iPhone: WEPopover. On the iPad you can use directly Apple's UIPopoverController