I would like to show a login view before a UISplitViewController in my app. I am not sure how to do that as Apple docs regarding iPad says that UISplitViewController should be a root view controller of the app.
Apple has built a rather handy view controller just for us called UISplitViewController and it harks right back to the iPad’s lowly beginnings. In this UISplitViewController tutorial, you’ll learn all about how to tame it! Also, since iOS 8, the split view controller works on both iPad and iPhone.
You’ll use a split view controller to handle the navigation and display. It’ll adapt to work on both iPhone and iPad. Note: This tutorial focuses on split view controllers. You should already be familiar with the basics of creating an iOS app first, such as Auto Layout and storyboards .
Check the Is Initial View Controller option. You’ll see an arrow to the left of the split view controller. This tells you it’s the initial view controller of this storyboard. Build and run the app on an iPad simulator. Rotate your simulator to landscape.
Navigation Controller: This UINavigationController will be the root view of your master view controller. This is the left pane of the split view when on iPad or when in landscape on a larger iPhone such as the iPhone 8 Plus.
Use a modal view controller to present the login view. You could either do a full-screen view that is presented without animation, or (how I would do it) a form style view that allows the split view controller to be seen but not interacted with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With