I'm developing (for learning iOS programming) an application for images-sharing.
The wanted layout is this:
For example you're an anonymous user and you open the app. You see the first controller with all images and a UIToolbar at the bottom with the two buttons. For example you tap on an image and you see a new view with the image details (the view is pushed with navigationcontroller). But also in the new view you can see the UIToolbar for sign up and login. So the UIToolbar it's always visible for the anonymous user.
My problem is always display the UIToolbar for anonymous users and push with a navigationcontroller the login or signup views.
I'm a newbie developer. Have you tips for do that? Thanks.
If I understand your problem correctly, you want to constantly display a UIToolbar for an anonymous user so that they can log in from any of your views? If this is the case, all you would have to do is include your login toolbar in every one of your views you want the user to be able to log in from.
Another option, if I remember correctly, a navigation controller is technically both a top bar and a bottom bar. You could enable and utilize this bottom bar instead of adding your login toolbar to each of your views. To disable it for a know user, you would simply just hide it.
Edit in response to comments: You should initialize the toolbar in your UINavigationController subclass, it would look something like this:
customNavController.h:
@property(nonatomic,retain) UIToolbar *toolbar
customNavController.m
if (toolbar == nil) {
toolbar = [[UIToolbar alloc] init];
navigationController.toolbar = toolbar;
}
That's the basic idea, though your initialize function for the toolbar will be different in that it will have the necessary UI for the login process. If you want some more information on the Navigation Controller I would highly recommend reading the class reference on it, it is actually very handy.