Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stick UISplitViewController in its own XIB?

my iPad app starts with a normal UIView showing a login. After the user logged in the screen is supposed to switch to a split view. XCode's SplitViewTemplate (and all examples on the web I found) however, place UISplitViewController in the main window's xib and define an outlet in the app delegate. I find that unlogical in my case because I don't need the controller at startup and would like to (following Apple's guidelines) place the split view controller in its own XIB. Has anybody a working example or a small step by step instruction? I always end up with the XIB not being loaded.

Or is it just NOT possible? But why would it not?

René

like image 871
Krumelur Avatar asked Jan 01 '26 08:01

Krumelur


1 Answers

You can put a UISplitViewController into a different XIB. You cannot have it be the owner, but you can have your app's delegate be the owner and load it when it removes the login view.

  1. Add UISplitViewController IBOutlet to app delegate
  2. Create a new, empty XIB for iPad
  3. Set the File's Owner to your app delegate class
  4. Add a UISplitViewController, connect to outlet in delegate
  5. Add views to split vew controller

Then, you just have to handle your login in the app delegate, load the new XIB, and display it.

like image 67
ughoavgfhw Avatar answered Jan 04 '26 04:01

ughoavgfhw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!