I have a UIView containing a login form, however when the user is already logged in, I want to show a logout button instead of the form.
My current approach is creating a subview for both the login form and the login button, overlapping each other in Interface Builder.
I would then only show one of the subviews at a time.
Is there a better way of doing this so it is easier to design in Interface Builder, while still using the same UIViewController?
If it matters the view is a modal view.
You could tweak your
UIViewControllerto actually be aUITabBarController, but tweak the tab bar so that it’s not visible when the controller is pushed to the screen:self.hidesBottomBarWhenPushed = YES;This should allow you to: