Questions tagged [uinavigationcontroller]

The UINavigationController class implements a specialized iOS view controller that manages the navigation of hierarchical content.

This class is not intended for subclassing. Instead, you use instances of it as-is in situations where you want your application’s user interface to reflect the hierarchical nature of your content. This navigation interface makes it possible to present your data efficiently and also makes it easier for the user to navigate that content.

The screens presented by a navigation interface typically mimic the hierarchical organization of your data. At each level of the hierarchy, you provide an appropriate screen (managed by a custom view controller) to display the content at that level.

Sample of use

References:

UINavigationController Class Reference

11391 questions
150
votes
16 answers

UINavigationController "back button" custom text?

The "back button" of a UINavigationController by default shows the title of the last view in the stack. Is there a way to have custom text in the back button instead?
Ali Shafai
  • 5,141
  • 8
  • 34
  • 50
143
votes
9 answers

How to get root view controller?

I need an instance of root view controller. I tried those approaches: UIViewController *rootViewController = (UIViewController*)[[[UIApplication sharedApplication] keyWindow] rootViewController]; Returns: null: Also when I try to get an array of…
Streetboy
  • 4,351
  • 12
  • 56
  • 101
142
votes
9 answers

How do I get the RootViewController from a pushed controller?

So, I push a view controller from RootViewController like: [self.navigationController pushViewController:anotherViewController animated:YES] ; BUT, FROM anotherViewController now, I want to access the RootViewController again. I'm trying //…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
131
votes
15 answers

UIRefreshControl - beginRefreshing not working when UITableViewController is inside UINavigationController

I've setup a UIRefreshControl in my UITableViewController (which is inside a UINavigationController) and it works as expected (i.e. pull down fires the correct event). However, if I programmatically invoke the beginRefreshing instance method on the…
wows
  • 10,687
  • 7
  • 27
  • 27
128
votes
9 answers

Completion handler for UINavigationController "pushViewController:animated"?

I'm about creating an app using a UINavigationController to present the next view controllers. With iOS5 there´s a new method to presenting UIViewControllers: presentViewController:animated:completion: Now I ask me why isn´t there a completion…
geforce
  • 2,593
  • 3
  • 28
  • 44
128
votes
9 answers

IOS7 : UIScrollView offset in UINavigationController

I'm currently migrating my app on ios 7 and I've been stuck for hours on the new navigationcontroller/bar management. Before, when we had a navigation controller, we had a snippet like this : UINavigationController *navController =…
streem
  • 9,044
  • 5
  • 30
  • 41
124
votes
36 answers

UINavigationBar Hide back Button Text

How can I hide the Back Button Text from an UINavigation Controller? I will only have the "<" and not "< Back"
Nils
  • 1,469
  • 3
  • 13
  • 17
122
votes
6 answers

UINavigationController without navigation bar?

I have a universal app, and on the iPad version I'm using UISplitViewController to create an interface similar to the Mail app. I was having trouble pushing new Detail views, so I decided to use a UINavigationController so I could just push and pop…
DOOManiac
  • 6,066
  • 8
  • 44
  • 67
120
votes
10 answers

SplitView like Facebook app on iPhone

I want to create an iPhone app that uses a navigation scene similar to the one pictured in the link Please note I do not want this to only work for iPad, I want it to work for iPhone exactly as pictured, when you click on a tableview item it hides…
120
votes
12 answers

Weird uitableview behaviour in iOS11. Cells scroll up with navigation push animation

I have recently migrated some code to new iOS 11 beta 5 SDK. I now get a very confusing behaviour from UITableView. The tableview itself is not that fancy. I have custom cells but in most part it is just for their height. When I push my view…
iur
  • 2,056
  • 2
  • 13
  • 30
113
votes
16 answers

Removing viewcontrollers from navigation stack

I have a navigation stack, with say 5 UIViewControllers. I want to remove the 3rd and 4th viewcontrollers in the stack on the click of a button in the 5th viewcontroller. Is it possible to do this? If so how?
Jean Paul
  • 2,389
  • 5
  • 27
  • 37
106
votes
12 answers

back button callback in navigationController in iOS

I have pushed a view onto the navigation controller and when I press the back button it goes to the previous view automatically. I want to do a few things when back button is pressed before popping the view off the stack. Which is the back button…
Namratha
  • 16,630
  • 27
  • 90
  • 125
99
votes
19 answers

No Swipe Back when hiding Navigation Bar in UINavigationController

I love the swipe pack thats inherited from embedding your views in a UINavigationController. Unfortunately i cannot seem to find a way to hide the NavigationBar but still have the touch pan swipe back gesture. I can write custom gestures but I…
mihai
  • 4,184
  • 3
  • 26
  • 27
98
votes
18 answers

How do I pop two views at once from a navigation controller?

I want to pop to the third view on the navigation stack back to the first view. I know how to pop one view at once: [self.navigationController popViewControllerAnimated:YES]; But how do I do two at once?
Adam Waite
  • 19,175
  • 22
  • 126
  • 148
98
votes
17 answers

How to enable back/left swipe gesture in UINavigationController after setting leftBarButtonItem?

I got the opposite issue from here. By default in iOS7, back swipe gesture of UINavigationController's stack could pop the presented ViewController. Now I just uniformed all the self.navigationItem.leftBarButtonItem style for all the…