Switching between views in iOS app - ios

I have a slide out menu in my app and each of the things in the menu goes to the respective pages.
Basically, when I tap "graph section" on the dashboard, I want it to go to the graph page without the Dashboard back button.
I've tried doing this with a modal segue but this provides a back button which means I can't access the menu on this page.
Anyone know how to do this?

I am not quite sure whether this answers it but have a look at:
Open View Controller programmatically and not using a Seque

I think you Use navigation controller.Once you hide the navigation controller for that particular page with [self.navigationController setNavigationBarHidden:YES]; and add UIButton and write it's action

Related

how to handle popUp's next viewController to embed in navigation?

I have a tab bar, an every item of it embedded in navigation controller, and several child viewControllers!
and I have a pop up view which I created in a new viewController!! to show my popUp I had to choose "present modally"!
when I go to a new viewController from my popUp on pressing button, it's not embedded in my navigation controller!
is there any way to fix it?
and the new viewControl also stays embed in navigation to show my tab bar
Unfortunately, what you are trying to achieve is not right, and please do not proceed with your initial plan.
I strongly believe a quick look at this could help you understand better UINavigationController and the difference between push vs present UIViewController in iOS.
As an answer to your question, you can imitate your wanted behaviour, but there is no direct native iOS way to accomplished your goal. Better, use pushViewController:animated: instead of present. More in the apple dev site - here.

How to add navigation drawer feature in later views(for ex: 2nd view) of the app?

I am trying to implement Navigation Drawer like menu on my iPhone project.
I have looked at the forums and find out there are many samples given in this link:
Stackoverflow Navigation drawer query
But, they have not helped me much. Because, all the apps are developed Navigation drawer in the Home screen(1st view) of the app itself and using window.rootViewController
My requirement is, I need Navigation Drawer like menu NOT in the home screen(1st view) of the app, rather need on the 2nd view of the app, hence I don't know how to add this feature.
Could someone please suggest me how to add navigation drawer like menu feature in later views(for ex: 2nd view) of the app?
I don't quite get how you want the menu. You can add Navigation Controller anywhere you want, all it's going to do is give you a Navigation Bar on which you can give a title and a Back button, usually with the name of the title of the previous page.
You can simply add the navigation where you want and control drag from the view or object you want to perform the segue. If it's a button you can use an IBAction with a performSegueWithIdentifier method.
Hope I could help

How to change the functionality of back button to display a list?

In my app I use UINavigationController to navigate through hierarchy of views but I encountered a problem - I need to display a list of buttons (when pushed they go to a view controller) instead of the back button.
What is that functionality called? I know how to change the button title and functionality but don't know how to create this list (a good example of my question is the Facebook left bar which shows Friends and other stuff).
In general you're looking for a drawer. That's what it is usually called. There are many libraries/frameworks out there that implement it in a different way so there is no general approach how to "change back button to...".
Check for yourself:
ViewDeck
DDMenuController
PKRevealController
MMDrawerController
Though, here you will find a very good article about very unique way how to implement this "hamburger" icon feature. They provide nice research and you'll find some very interesting information there.
It seems that you need control like MMDrawerController for showing side menu.
Try to make modal segue or hide back button programmatically. Then you add your own button and configure it. Default back button only return you to previous view, you need to make your own.

Adopting a side menu in iOS app. View controllers structure issue

I'm designing an app intended to have the following navigation structure: I need to have a welcome view with "Sign up" and "Sign in" buttons as most of apps have:
This view does not show any navigation bar, as it seems to be the common thing. If "Sign In" tapped, then the login view will be presented modally:
And if "Sign up" tapped, the welcome view navigates to a form requesting user input to create an account:
Then, once the user logs in and enters the app, I'd want it to have side menus similar to Facebook, YouTube or Spotify:
Being the central panel a UINavigationController. Left side panel I think it usually is an 'UIViewController'...
The point is, I donĀ“t know what the rootViewController of my app should be, and what hierarchy of view controllers should I have. I've thought about a couple of possibilities:
1) Being the rootViewController an UINavigationController, push the welcome view hidding the navigation bar (is that possible?), presenting the "Sign In" view if needed or pushing the "Sign Up" view. Once the user has logged in, pop these views from the rootViewController, that is a UINavigationController, and then push in such navigation controller the custom view controller managing the side menu stuff.
2) Being the rootViewController the side menu custom view controller, and setting as its central panel an UINavigationController. Push there the welcome view and so on, without setting any view controller for the left/right panels, and then when user has logged in, pop those views from the central panel's UINavigationController, push there the corresponding view, and now setting the left/right panels
I hope I've explained myself. Maybe there is another and better approach to handle this scenario. Does somebody implemented an app like this? I need help with this issue, and also I'll appreciate being recommended a custom library/control providing the side menu stuff from someone who has used one and it is easy to use and customize. I know there are lots of them (MMDrawerController, JASidePanels, for example), but I'd like to have some opinions from people that had developed an app with one of them.
Note: I need to support iPad as well, and iOS 5+
Thanks a lot
I would recommend you to have two main ViewControllers, one for login/signup and second one for the main content with side menu. After the user will log in, just change the window rootViewController to the second one.
For the side menu you can use:
JTRevealSidebar for iOS
GSSlideMenu
JASidePanels
MMDrawerController
I've design an app using ECSlidingViewController (created by Michael Enriquez) which works very fine for me and easy to use.
Tutorial also available on youtube : http://www.youtube.com/watch?v=tJJMyzdB9uI
As for Swift, you could use InteractiveSideMenu library as Side Menu. It's quite easy to implement and transition animation looks pretty smooth.
It was a good find for my project.

iOS views navigation best practices

I'm very new in iOS dev (but have more then 10 years overall experience with other platforms so it should help). Now I have to create relatively complex iOS application and do it very fast :).
I created application based on 'Tabbed Application' template using storyboard. Then I added login view that uses JSON to communicate with web application. I made this view initial (first that user sees) by moving appropriate arrow from default tab bar controller to my 'login view controller'.
On the login view I have text fields and login button. By clicking button application verifies user's name and password and then navigate him to default tab bar controller (created by Xcode). I do it with this code:
WPFirstViewController *fvc = [self.storyboard instantiateViewControllerWithIdentifier: #"TabBars"];
[fvc setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentViewController:fvc animated:YES completion:nil];
Everything works fine, but I'm confused than I didn't use graphics lines between views on storyboard and I'm not sure that my approach is correct.
So, questions is how should I navigate user from the login view to tab bar controller? What is the best way in my case? And also, how for example should I navigate user from one of the tab view controller pages page (for example, by clicking button 'Settings') to corresponding view and then back? Maybe somebody could share a link to some good article.
Sorry for the long text. Thank you in advance for your help!
Modal view controllers are supposed to be used for cases where you need to get some critical information from the user (or present some to the user), without which you can't continue with the app. A log in controller would be a good choice for a modal view controller, but your main controller, your tab bar controller isn't. It would be better to present the login controller modally from the controller in the first tab of your tab bar controller. If you do this from viewDidAppear, and with no animation, it will be the first thing the user sees. When the user successfully logs in, just dismiss that controller, and you'll be ready to go in your first tab.
I'm not sure what you mean by your second question. The user navigates between the tabs by clicking on a tab -- you don't need to do anything in code for that.
I would advise you not to use storyBoards. Also, if you are planning to have a navigation controller on your app, then you will definitely use the feature of pushing view controllers on a self.navigationViewController of your view controller. It's easy to use, really easy!!
Typically, login view controllers should be modally presented with: presentModalViewController:animated:
In regards to your UITabBarController, each tab can be a UINavigationController, which will enable you to maintain a stack of UIViewControllers.
All the remains is determining whether the view controller you want to present is modal, or part of said stack.

Resources