uinavigationcontroller - UITabBarController in UISplitViewController with Storyboard -
i have uisplitviewcontroller
uitabbarcontroller
master. uitabbarcontroller
contains 1 uinavigationcontroller
uitableviewcontroller
root (it main menu of app).
after tapping on cell in main menu, in uisplitviewcontroller
's detail part uitableviewcontroller
should presented (let's call detail view).
in landscape mode works ok.
but in portrait, whet tap on cell in main menu, detail view presented modally, , not pushed, supposed to. also, when rotating landscape portrait, main menu presented instead of detail view, , after click on main menu's position show detail view, presented modally no possibility rotate or go back.
removing uitabbarcontroller
, setting uinavigationcontroller
uisplitviewcontroller
's master works want (in landscape mode have menu|detail views side side , in portrait mode controllers behave on regular uinavigationcontroller
). uitabbarcontroller
gone.
what i've tried:
- every possible segue type - none of them works way want
- subclassing
uistoryboardsegue
implement custom behavior depending onuisplitviewcontroller
'sviewcontrollers
param (in portrait mode has one view controller - master) - couldn't recognise classes (thank swift!)
what want entirely in storyboard (ok, custom segues doesn't count) - want elegant solution , refuse believe it's impossible.
working on ios 8 sdk, xcode 6.2, iphone 6 plus
unfortunately there no absolutely elegant solution 1 (as far i've managed accomplish). hoping apple sort out, in meantime, nicest way possible:
- place 1 custom segue instead of show detail
- in
perform
method of custom segue have like:
- (void)perform { masterviewcontroller *source = self.sourceviewcontroller; appdelegate *appdelegate = [uiapplication sharedapplication].delegate; uisplitviewcontroller *splitviewcontroller = appdelegate.splitviewcontroller; if ([splitviewcontroller.viewcontrollers count] > 1) { [source performseguewithidentifier:@"showdetail" sender:source]; if (appdelegate.masterpopovercontroller) { [appdelegate.masterpopovercontroller dismisspopoveranimated:yes]; } } else { [source performseguewithidentifier:@"showdetailsmalldevice" sender:source]; } }
[splitviewcontroller.viewcontrollers count]
here separate large devices (ipads & iphone 6 plus) , other, smaller ones- in storyboard, wire 1 segue named
showdetail
showdetail, detail navigation controller, , directly contents view controllershowdetailsmalldevice
show (push)
see example:
Comments
Post a Comment