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
95
votes
13 answers

Dark shadow on navigation bar during segue transition after upgrading to Xcode 5.1 and iOS 7.1

When I am navigating back & forth between parent and child controllers in a master - detail navigation controller, i see a dark shadow on the right side of navigation bar at top. It started after I upgraded to Xcode 5.1. It feels rough and…
Nihat
  • 3,055
  • 3
  • 18
  • 28
93
votes
20 answers

Programmatically navigate to another view controller/scene

I got an error message during navigating from first view controller to second view controller. My coding is like this one let vc = LoginViewController(nibName: "LoginViewController", bundle: nil) self.navigationController?.pushViewController(vc,…
Nurdin
  • 23,382
  • 43
  • 130
  • 308
93
votes
16 answers

How to Navigate from one View Controller to another using Swift

I'd like to navigate from one view controller to another. How can I convert the following Objective-C code into Swift? UIViewController *viewController = [[self storyboard]…
sathish
  • 1,180
  • 1
  • 9
  • 9
93
votes
12 answers

Set a custom subclass of UINavigationBar in UINavigationController programmatically

Does anyone know how can I use my custom subclass of UINavigationBar if I instantiate UINavigationController programmatically (without IB)? Drag a UINavigationController in IB show me an under Navigation Bar and using Identity Inspectory I can…
Duccio
  • 939
  • 1
  • 7
  • 3
91
votes
5 answers

Set rootViewController of UINavigationController by method other than initWithRootViewController

How Do I set the rootViewController of UINavigationController by a method other than initWithRootViewController? I want use initWithNavigationBarClass:toolbarClass: to deliver a custom toolbar for my NavigationController, so I don't think I can use…
drc
  • 1,905
  • 4
  • 22
  • 28
89
votes
21 answers

Popover with embedded navigation controller doesn't respect size on back nav

I have a UIPopoverController hosting a UINavigationController, which contains a small hierarchy of view controllers. I followed the docs and for each view controller, I set the view's popover-context size like so: [self…
Ben Zotto
  • 70,108
  • 23
  • 141
  • 204
89
votes
13 answers

iPhone: Setting Navigation Bar Title

Hey all. I'm still pretty new to iPhone development, and I'm having a bit of trouble figuring out how to change the title of my Navigation Bar. On another question on this site somebody recommended using : viewController.title = @"title…
89
votes
5 answers

How to draw a transparent UIToolbar or UINavigationBar in iOS7

I would like an entirely transparent UIToolbar and/or UINavigationBar. I have tried the various incantations suggested for pre- and post-iOS 5 but none seem to work any more. How might this be accomplished in iOS 7?
Ben Packard
  • 26,102
  • 25
  • 102
  • 183
87
votes
5 answers

Programmatically call navigation controller back button on iOS

In a UINavigationController-based iPhone app, in a method I would like to perform the programmatic equivalent of the back button being pressed and going back a view. i.e. automatically press the Jobs button as seen here: Is there a generic iOS call…
oberbaum
  • 2,451
  • 7
  • 36
  • 52
86
votes
17 answers

How to add 2 buttons into the UINavigationbar on the right side without IB?

How can I add 2 buttons into the UINavigationBar without XIB? The 2 buttons should be aligned on the right side of the UINavigationBar. I know how I can add one button, but how about two?
Alexander
  • 1,121
  • 2
  • 10
  • 6
84
votes
16 answers

How can I pop a view from a UINavigationController and replace it with another in one operation?

I have an application where I need to remove one view from the stack of a UINavigationController and replace it with another. The situation is that the first view creates an editable item and then replaces itself with an editor for the item. When I…
82
votes
16 answers

Disable swipe back gesture in Swift

Been looking around on here for a while but can't seem to find a working solution. I'm trying to disable the swipe to go back to previous view gesture, in Swift. I've tried a variety of solutions…
Phil Hudson
  • 3,819
  • 8
  • 35
  • 59
82
votes
14 answers

Changing back button in iOS 7 disables swipe to navigate back

I have an iOS 7 app where I am setting a custom back button like this: UIImage *backButtonImage = [UIImage imageNamed:@"back-button"]; UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom]; [backButton…
lehn0058
  • 19,977
  • 15
  • 69
  • 109
81
votes
5 answers

presenting ViewController with NavigationViewController swift

I have system "NavigationViewController -> MyViewController", and I programmatically want to present MyViewController inside a third view controller. The problem is that I don't have navigation bar in MyViewController after presenting it. Can you…
79
votes
17 answers

How to identify previous view controller in navigation stack

I have 2 seperate navigationcontrollers, one with RootViewController A and the other with RootViewController B. I am able to push ViewController C onto either A or B's navigation stack. Question: When I am in ViewController C, how can I find out if…
Zhen
  • 12,361
  • 38
  • 122
  • 199