iOS:Switching between views using UINavigationBarController - ios

First of all, I am using XCode 4.2 and I am not using storyboards. I need to make an application with 2 views.
First view will contain a button and a navigation bar, the button's IBAction should only go to the second view, and from the secondview you should be able to go back to the first view via the Navigationbar.
My problem is the navigation controller / navigation bar, how do I set that up ?
I know that it would be smart using the singleView app and then add a navigation controller, the problem is that I dont know how to set it up in the code.
I have searched for similar problems on the internet, and I keep getting into posts where they use another SDK or using an older xcode etc.
What I do know is how to make the button, actions and delegation.
Anyone out there who is sitting with the one and only tutorial I am missing or can tell me how to do it ?
Thank you

Use the Master-Detail Application template. Ignore the stuff for tables, it has navigation stack implemented in it. By deleting the tables, you should be pretty much left with what you are after.

You should go to http://developer.apple.com/, search for UINavigationController, click on UINavigationController Class Reference, then look at one of the linked sample code projects there.

if you really want to learn how to implement it from scratch (and not depend on the master-detail template), i highly recommend the following resources:
the apple documentation on UINavigationController
the solutions from the big nerd ranch iOS Programming guide (particularly the Homepwner example)
also found this tutorial in a quick google search, but haven't fully vetted it in xcode 4.2 (there will likely be small differences in how you have to go through the steps).

Related

ios: How to implement navigation of a slide out menu?

So far I have been working with NavigationController. It's great for hierarchical navigation.
But, how do I implement a slide out menu that exists on every page, and is able to jump to any page?
Not caring about the design, I guess we would need to load/unload xib files manually to the superview?
Is this a good practice?
Probably the best way to get you going is to implement/check some of the already developed open source solutions.
Please, check out:
MMDrawerController which is a simpler version
and MSDynamicsDrawerViewController which is a bit more complicated (to develop) because it uses iOS 7 Dynamics.
Cheers.

On an iPad, how to create a left side menu to let the contents displayed at the centre according to the item tapped on the menu

I am very new to iOS development. Currently, I am trying to develop an iPad app, which is used for taking orders in a restaurant. When I am trying to create the UI on an iPad, I want to create a left side menu to let the contents displayed at the centre according to the item tapped on the menu. Which is similar to this: http://www.dhtmlx.com/blog/wp-content/uploads/2011/02/ipad_menu_final.jpg
As I am very new to the iOS development, can anybody tell me where I can learn iOS development step by step. And are they any samples of this kind of app that I can refer to?
Thanks very much!
there are many tutorials for creating split view application as links provided by #PratyushaTerli and otherwise you can use direect way as recommended by #antonio MG and there is another two good links for creating them which are : https://github.com/mikefrederick/MFSideMenu (good demos in it using story board or using xib's ) and you can look on project on github named - mmdrawercontroller.
annother good project is this
As Antonio MG said, the easiest way to do this is with Master/Detail project in Xcode. It uses the UISplitViewController logic of one 'Master' controller which controls the appearance of detail content in the 'Slave' or 'Detail' controller aside.
The sample Xcode project should be enough to make you understand how UISplitViewController and its UISplitViewControllerDelegate work together. Or also checkout this tutorial: http://www.raywenderlich.com/1040/ipad-for-iphone-developers-101-uisplitview-tutorial
Just create a Master/Detail project and you will have the basic structure of that kind of behaviour. The rest is just customising the table and the cells.

IOS facebook app slide option menu [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
SplitView like Facebook app on iPhone
I need a control that will split a screen into 2 different views when click.
It is kind of like this [1]: http://i51.tinypic.com/2112zwh.png
I had used inferis/view deck but it screw out my navigation controller.
Basically it can't perform any segue
I am using StoryBoard with navigation controller and also tab controller.
Anyone has any idea how to have this kind of menu but works with storyboard and navigation controller, tab controller?
I made a video (3 parts) on youtube on how to make a sliding menu like the on you are looking for. I show you how to set up the project and get everything linked up.
http://www.youtube.com/watch?v=tJJMyzdB9uI
You will have to create UINavigationControllers instead of plain UIView controllers if you want to use that tutorial, but its basically just selecting one or the other.
The cool thing about ECSlidingViewController (Its the one I use) is that just about everything you want to configure (how far a view slides, the animations, left or right side) is done with a single line of code (sometimes 2 or 3 lines)
Try it out and see if it works for you?
I used the JTRevealSidebar Project to build mine. I used storyboards, and segues in my project and got everything working without any troubles. Take a look at the demos, and it should be pretty easy to implement. If you have any specific issues when you do get it implemented feel free to post questions about your issues.

What is the correct pattern for creating a header navigation across the app?

I have been googling around, and I found some suggestions to use UINavigationController and sometimes the UITabBarController also makes sense (but to a lesser degree).
I never used a UINavigationController ...I just tried to and when I dragged it to the storyboard, it put two screens on the storyboard (a navigation controller connecting to a UITableView). So I think this isn't what I actually needed.
Can someone please help me understand what I need to do to make a header navigation that is persistent across all the screens? In it I want to have sections like:
Home | Section1 | Section2 | Section3
Thanks!
It may help to consider what the user will see as the "meaning" of the structure you use.
The sense of a navigation controller is as a container that lets you show a sequence of content controllers where actions on one of them lead logically to the next. The sense of a tab bar controller is of (mostly) unrelated content controllers that co-exist and don't have (much) dependence on each other.
I think it's good to start with the purpose of the interface rather than the appearance.
I'm gonna suggest to you something that helped me a lot, which is to go download Stanford's iPhone and iPad Development course CS193P from iTunes U (you go in iTunes Store, search for it and download it).
Secondly, you shouldn't ask such general questions on SO, the question you asked is something you can find out on your own by researching, reading Apple's developer documentation, or doing a tutorial as I just suggested. Best of luck.

Split View inside of a Tab Bar in an iPad Application

When the iPad first came out, I recall that Apple frowned upon the use of a Split View inside of Tab Bar Item View. Whether or not they rejected applications that used this design I don't recall or know anything of.
Is this design still frowned upon by Apple? If you create an application that uses this design will it be rejected by Apple? I know there are third-party API's now that help you write applications that utilize this design pattern which leads me to believe that Apple no longer cares, but I just wanted to be sure about this.
If anyone can shed some light on why Apple frowned upon this design that would be helpful because I don't understand what about this design was an issue for Apple.
I can't find the citation at the moment, but there used to be a section in the HIG that said that you must not do this, and then they changed it to one saying you should try to avoid doing this. So I think you're clear, as long as the design makes sense. Sadly I can't find where that phrase occurred — maybe it was taken out all together.
At any rate, there's nothing in the HIG under either tab bar or split view that says you can't do what you want.
I just stepped over this, too.
This also didn't work in the Interface-Builder prior to 5.1.
But i just tried today and recognized that you can simply add a relationship from a tabbar controller to a splitview inside interface builder (this did not work before).
However, only the detail view shows up when running the app and select the tab containing the splitview.
edit: This seems to work out very easy if you compile for 5.1. There seems to be a change in handling Splitviews.
Just try it out:
In your Storyboard, create a Tabbar Controller
add a Split View Controller
Create a Reference from the Tabbar Controller to the Split View Controller
Now you need to create your Master and Detail Controllers
I am not finished with the implementation yet, but hope this helps.

Resources