Friday, 15 May 2015

ipad - How do I use popover segues with a universal storyboard on iOS 7? -



ipad - How do I use popover segues with a universal storyboard on iOS 7? -

i'm in process of moving hard-coded layouts new universal storyboard scheme available in xcode 6. it's great able create 1 storyboard that, through magic of auto-layout, work on both iphone , ipad. , understanding universal storyboards backwards-compatible ios 7.

however, i'm running problem using popover segues. on ios 8, new 'present popover' segue display popover on ipad interface , modal view controller on iphone interface. behavior want, when run universal storyboard on ios 7, app crashes whenever effort popover segue. here's error message get:

terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[uipopovercontroller initwithcontentviewcontroller:] called when not running under uiuserinterfaceidiompad.'

this bit annoying, don't want have resort separate storyboards each ui idiom.

it looks these choices:

create subclass of uistoryboardsegue show popover on ipad , modal view on iphone. requires manually changing class of popover segues in app. create 2 segues out of every bar button item, table cell, etc. - 1 that's pure 'popover' segue , 1 that's pure 'modal' segue. in case, i'll unable control-drag next screen , have create custom action methods invoke right segue based on current ui idiom. abandon universal storyboards , create device-specific storyboards until can require ios 8 users.

none of these great alternatives, wondering: have other options? missing problems proposed solutions?

xcode 6 supports unified storyboards. storyboard can add together or remove views , layout constraints based on size class view controller displayed in. rather maintaining 2 separate (but similar) storyboards, can create single storyboard multiple size classes.

but size classes based on uitraitcollection supported on ios8. that's why it's crashing on ios7.

ios ipad storyboard ios-universal-app

No comments:

Post a Comment