i need present modal view controller before showing split view controller. need because user have log in.
have read answers on forum suggesting modal view controller should presented appdelegate when trying so, nothing happens.
have set view controller in same storyboard rest of interface in , have given view controller identifier `loginviewcontroller`. trying show view controller in appdelegate this:
code:
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { if (ui_user_interface_idiom() == uiuserinterfaceidiompad) { uisplitviewcontroller *splitviewcontroller = (uisplitviewcontroller *) self.window.rootviewcontroller; uinavigationcontroller *navigationcontroller = splitviewcontroller.viewcontrollers.lastobject; splitviewcontroller.delegate = (id) navigationcontroller.topviewcontroller; uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard_ipad" bundle:nil]; loginviewcontroller *lvc = (loginviewcontroller *) [storyboard instantiateviewcontrollerwithidentifier:@"loginviewcontroller"]; lvc.modalpresentationstyle = uimodalpresentationfullscreen; [splitviewcontroller presentmodalviewcontroller:lvc animated:yes]; } [_window makekeyandvisible]; return yes; } when so, nothing happens. no errors, no modal view controller, no nothing. application shows split view controller.
can tell me how can show modal view controller before showing split view controller?
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment