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
53
votes
5 answers

InputAccessoryView docked at bottom

I'm trying to achieve similar positioning behavior as the bottom text input bar in Apple's Messages app. I have tried many approaches, searched high and low and there are many similar questions but none have been satisfactory. To specify: There is…
52
votes
9 answers

Why does my SwiftUI app crash when navigating backwards after placing a `NavigationLink` inside of a `navigationBarItems` in a `NavigationView`?

EDIT: This has been fixed in iOS 13.3! Minimal reproducible example (Xcode 11.2 beta, this works in Xcode 11.1): struct Parent: View { var body: some View { NavigationView { Text("Hello World") …
Robert
  • 981
  • 1
  • 15
  • 24
52
votes
10 answers

Change the color of iOS Navigation Bar

I'm trying to change the color of my navigator bar but I found that it's only impossible if the navigator is the root one. I'm trying this: self.navigationController?.navigationBar.translucent =…
Anthony Shahine
  • 2,477
  • 3
  • 18
  • 24
52
votes
11 answers

Add subtitle under the title in navigation bar controller in Xcode

So I'm wanting to add a "subtitle" under the title in the navigation bar in navigation controller. Mostly everything I look up so far wants me to use CGRect. I don't know a whole lot what that is and it sounds like its wanting me to create an entire…
52
votes
11 answers

NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController

so I'm making an app with 5 view controllers, the first is embedded in a UINavigationController and the segue between the first 4 view controllers works fine. However introducing a 5th View Controller has broken this, and I'm getting the…
DouglasBoone
  • 523
  • 1
  • 4
  • 4
52
votes
10 answers

iOS how to detect programmatically when top view controller is popped?

Suppose I have a nav controller stack with 2 view controllers: VC2 is on top and VC1 is underneath. Is there code I can include in VC1 that will detect that VC2 has just been popped off the stack? Since I'm trying to detect the popping of VC2…
JMLdev
  • 846
  • 2
  • 10
  • 21
51
votes
3 answers

Showing/hiding navigation bar with smooth animation

I have a navigation based app. The first view (rootcontroller) starts with three large buttons only. No navigationbar. From there, everything else is tableviews and have navigation bars. I'm doing this to show/hide the navigation…
4thSpace
  • 43,672
  • 97
  • 296
  • 475
50
votes
9 answers

Recognize tap on navigation bar title

Could someone please help me recognise a tap when a user taps on the Title in the Navigation Bar? I would like to recognise this tap and then animate the tableHeaderView appearing. Possibly sliding the TableView down. The idea being that the user…
Richard
  • 1,688
  • 3
  • 16
  • 21
50
votes
4 answers

Popping ViewController on Swift

I need to pop a UIViewController from the navigation controller. Just writing this line of code but taking an exception; unexpectedly found nil while unwrapping an Optional value self.navigationController.popViewControllerAnimated(true) If I…
erdemgc
  • 1,701
  • 3
  • 23
  • 43
50
votes
8 answers

Meaning of Warning "while a presentation is in progress!"

When I am integarting the Instagram in my project. I am getting a image from UIImagePickerController and after it i want to send it to Instagram But when I am sending image to Instagram by UIDocumentInteractionController delegate method…
chakshu
  • 1,372
  • 2
  • 10
  • 21
49
votes
7 answers

iOS: popViewController unexpected behavior

I've been searching the internet for a solution. There's nothing I could find. So: I'm using a UINavigationController. I am pushing two UIViewControllers onto it. In the second pushed ViewController i am executing this code: -…
Christoph
  • 491
  • 1
  • 4
  • 3
49
votes
5 answers

How to detect if view controller is being popped of from the navigation controller?

I currently need to implement some code when the top view controller is being popped off from my navigation controller. Is there a way to detect when the view controller is being popped off the navigation controller stack? As much as possible I…
aresz
  • 2,589
  • 6
  • 34
  • 51
48
votes
7 answers

popping and pushing view controllers in same action

is is possible to pop a view off the navigation stack and then push another straight onto it? I'm trying to implement a flat hierarchy for this section and would like to have a segmented controller but I can't make the segmented controller look…
Josh
  • 3,445
  • 5
  • 37
  • 55
48
votes
14 answers

UINavigationBar/Status Bar issue in IOS7

Final EDIT (Rather than having an overly long question with edits making a final edit for clarification, please see other edits if needed). Controller Setup I have an application that is setup as follows: InitialViewController (subclass of…
StuartM
  • 6,743
  • 18
  • 84
  • 160
47
votes
17 answers

iOS 7 Status Bar Collides With NavigationBar

I have a view controller in my app that has a navigation bar dragged on it in the storyboard. It was working fine in the iOS 6 but in iOS 7 it look like this: The status bar and the navigation bar should no collide with each other. I have seen a…
AJ112
  • 5,291
  • 7
  • 45
  • 60