I’m changing my app to add an in app purchase. When I initially set up the app I used interface builder but now i need to decide which class & xib file to load on app launch based on whether or not a user has purchased a feature.
My app is set up with a tab bar controller that has a naviagion controller for each tab. Inside the MainWindow.xib file I’ve told IB to use the HomeView.xib and HomeView class. Now I need to check if a feature has been purchased and load either HomeView or HomeView2. I don’t know where in the app to tell the naviagionController which class and view to load as I previously set all this up in interface builder.
Can I make this decision inside the HomeViewNavigationController instead of IB automatically making this decision for me?
Thanks in advance for your help!
Keep it simple.
In HomeView.xib, have two different views you can load. Have the view of the UIViewController in the xib be the “container view”. Do your detection code in the viewDidLoad of your HomeView controller and then add the proper view as a subview.