Categories
Dev

UISplitViewController Question

Brent Simmons asks about dealing with three-level hierarcy in an adaptive split view controller (presumably for Vesper this means Tags and Note list on the left, Note details on the right).

His answer so far is here: https://gist.github.com/anonymous/797aa235dffcf9ed15e3.

And this tip is excellent:

And — bonus — @FriedLemur has the tip of the day (regarding DerivedData):

Option key turns Clean into Clean Build Folder, pretty much rm -rf

That’s so much better than me trying to remember where the DerivedData folder actually is.

Categories
Dev

Screenshots for new devices

A universal iOS 8 app will run on the following devices.

  1. iPhone 4s (3.5-inch)
  2. iPhone 5 (4-inch)
  3. iPhone 6 (4.7-inch)
  4. iPhone 6 plus (5.5-inch)
  5. iPad

For a non-trivial app with 5 screenshots plus preview videos, we’re all going to be very busy…

Categories
Dev

iOS 8 Popover Presentations

Popovers are finally(!) possible on iPhone on iOS 8. The catch is that by default, they get presented modally over the full screen — not exactly what I’d call a ‘popover’.

Thankfully it’s easy to force the presentation to be an actual popover. UIPopoverController is pretty much a thing of the past. With iOS 8 you just present a view controller with a popover presentation style which is a new Adaptive Segue available in Xcode 6.

How to do it

Firstly, your view controller that’s presenting the popover should implement the UIPopoverPresentationControllerDelegate protocol.

Next, you’ll need to set the popoverPresentationController’s delegate.

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Assuming you've hooked this all up in a Storyboard with a popover presentation style
    if ([segue.identifier isEqualToString:@"showPopover"]) {
        UINavigationController *destNav = segue.destinationViewController;
        PopoverContentsViewController *vc = destNav.viewControllers.firstObject;

        // This is the important part
        UIPopoverPresentationController *popPC = destNav.popoverPresentationController;
        popPC.delegate = self;
    }
}

And finally, implement this one little delegate method.

- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller {
    return UIModalPresentationNone;
}