FAQ Database Discussion Community


strange behaviour with UINavigationController and autolayout top layout guide

ios,layout,uiscrollview,uinavigationcontroller,autolayout
I am using auto layout for a controller under navigation controller. For this controller, I mainly have a scroll view inside the controller's view. the alignment rule for the scroll view is top layout guide, bottom layout guide, leading aligned with super view and trailing as well. the layout is...

Set custom font along with text color

ios,objective-c,xcode,uinavigationcontroller
I have set my navigation controller titleTextAttributes to use a custom font, i have used the following code for this [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"Neon80s" size:21],NSFontAttributeName, nil]]; I am wanting to include a colour for this? If i do it seperately to the custom font it overrates it so the colour...

Navigation Controllers in Swift

swift,uinavigationcontroller,navigationcontroller
I have embedded my story board view controllers with the navigation controller. However, I want one view specific controller to not have the navigation bar. How can I do this?

How should a tab bar controller be integrated into a navigation controller workflow?

ios,uinavigationcontroller,uitabbarcontroller
I've been given a design with the following workflow: User logs into an app Upon successful login the user sees a tableview with data rows Upon clicking a data row the user is taken to a view controller with a tabbed inteface. Each view controller in the tabbed interface provides...

iOS Disable popping to root view on pressing tab bar button

ios,uinavigationcontroller,uitabbar,uitabbaritem,poptoviewcontroller
I'm looking to disable the functionality of pressing my tab bar and returning to the root view in the navigation hierarchy whilst also keeping this functionality for a button in my navigation bar. So the only way I want the user to go back to the root view is by...

How to navigate to another view controller in push notifications

ios,iphone,uinavigationcontroller
I am doing one application.In that i have some view controllers as like A->B,A->C,A->D and B->E,C->F,D->G and E->H,F->I and G->J.So i am in E view controller,whenever notification comes,i have to move to G view controller.And if i am in any view controller except G,i need to move to G view...

Start a new UIViewController from a UINavigationController

ios,objective-c,uiviewcontroller,uinavigationcontroller,nib
I have a UINavigationController and I want to start from that navigation a new UIViewController that has its own view controller . when I tried to do that , I faced this exception Could not load NIB in bundle loaded)' with name and directory 'Main.storyboardc'' I am adding the new...

App crashes due to unrecognized selector sent to VC

ios,objective-c,exception,uinavigationcontroller,segue
My app crashing due to unrecognized selector sent with segue. I know it's a common question in stackoverflow. I tried all the solution but could not get through this. I think i'm missing something. My current project throws this exception, but a new project with this same code does not...

Swift Changing Navigation ViewController stack (programatically)

ios,swift,uiviewcontroller,uinavigationcontroller
I'm having some trouble with the logic in my application. I have been looking for a way to change the navigation controller's viewcontroller stack. For several reasons. One, I have a login and sign up page, which each have buttons pushing to the other view controller. Creating an /infinite/ loop...

How to link customized navigation bar to navigation controller?

ios,swift,uinavigationcontroller
I created a normal view controller with a customized navigation bar. Later I changed my mind to embed the view controller into a navigation controller. And I noticed that embedding the view controller into a navigation controller will create another navigation bar! As the image show: I am wondering if...

push a UIViewController when received a remote notification

ios,uinavigationcontroller,uitabbarcontroller
The project's initial viewController is a UITabBarViewController, I want to push a new viewController when received a remote notification, but not sure now which viewController is in, how to deal with it?

Side menu with dynamic table cell will navigate page but with navigation controller coming as nil

ios,swift,uinavigationcontroller
I have create sidemenu using this. But the difference is only i have used dynamic UITableViewCell instead of static. Now i face navigation issue while click on side menu item. I have used navigation code like: dispatch_async(dispatch_get_main_queue()) { let propertyListing = self.storyboard?.instantiateViewControllerWithIdentifier("PropertyListing") as! PropertyListingController self.showViewController(propertyListing as UIViewController, sender: propertyListing )...

Swift, Navigation bar should not be shown on the login screen

swift,uinavigationcontroller,uinavigationbar
I have initialized Navigation controller from the root controller (viewController), and wrote down the code to hide it initially self.navigationController?.setNavigationBarHidden(navigationController?.navigationBarHidden == false, animated: true) But when i go to next screen and click on the back button , i can see my navigation bar on my Login screen. Ideally we...

iOS8 Add Button not showing up in Navigation bar

ios,uinavigationcontroller
I am trying to add the "+" button on the right side of my Navigation Controller. I have added a title to the controller and it works great, however the + button does not show up at all. self.navigationBar.barTintColor = [UIColor purpleColor]; //the buttons self.navigationBar.tintColor = [UIColor whiteColor]; self.navigationBar.topItem.title =...

Swift : prepareForSegue with navigation controller

ios,swift,uinavigationcontroller
I am developing an iOS application in Swift. I want to send data from a view to an other one, using the prepareForSegue function. However, my target view is preceded by a navigation controller, so it doesn't work. How can I do this please ?...

UINavigationBar disappears on modal

swift,uinavigationcontroller
I have a nav bar setup in Swift, it switches properly to other nav view controllers, but when I hit a button that is set to modal back to current view controller, to refresh the content, the nav bar disappears! How is this fixed?

Swift didReceiveRemoteNotification - Navigate to rootviewcontroller no matter where in app user is located (Now With Error Message)

ios,swift,uinavigationcontroller,apple-push-notifications,rootview
Upon receiving push notification in the IOS Swift app, I would like to do two things based on content in notification: Either navigate to screen (deeplink) so i would have to navigate from rootviewcontroller through several screens. Navigate to rootviewcontroller, no matter where the user is located in the app....

UINavigationBar custom color with Embeded UInavigatonController in storyboard

ios,xcode,uinavigationcontroller,uinavigationbar
It's a silly question, but I really want to know, how can I add custom color in my default UINavigationBar which actually added to my viewController from Editor > Embed in > NavigationController. I add this: [[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:244/255 green:119/255 blue:39/255 alpha:1.0]]; In my AppDelegat in didFinishLaunchingWithOptions but nothing...

Navigation Controllers/View Controllers working with a stack

iphone,xcode,swift,uiviewcontroller,uinavigationcontroller
I am trying to create an iPhone game app with the Swift programming language using Xcode. I created the project as a single-view application, and I have been adding view controllers and connecting them up with segues as I need them, using the Storyboard. From what I have come to...

How to setup first time launch of an iOS App

ios,objective-c,xcode,uinavigationcontroller
I want to show the terms and conditions only the first time of my app launch. Currently I am writing my code in didFinishLaunchingWithOptions. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Handle launching from a notification if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"]) { NSLog(@"Already Run"); } else { [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HasLaunchedOnce"];...

How to change Default navigation item color

ios,uinavigationcontroller
I have an Navigation bar and I want to change its left item default color to White. I WANT THE BLUE TO BE WHITE I want to done this programmatically. Currently i am using this code to change the color and title of navigation bar - (void)viewWillAppear:(BOOL)animated { [self.navigationController setNavigationBarHidden:NO];...

Performe, navigate, to child view from App Delegate

ios,objective-c,iphone,uinavigationcontroller,swrevealviewcontroller
I'm trying to open child view(PostReaderViewController, the fourth view on Image ) when application is lunched through Push notification It's. Storyboard Image : This is my Code : - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... //Detecting if the app was lunched by clicking on push notification : NSDictionary *userInfo =...

IOS - Translucent Navigation Bar over content

ios,xcode,uinavigationcontroller,uinavigationbar
I have a tableView with a UIImage in the header. What I what to accomplish is the same as twitters profile page. A translucent navigation bar over the cover image. All I have done so far is navigationBar.translucent = true and set my coverImage.frame.origin.x = -50 but the navigationBar still...

Storyboard ViewController UI Glitch

objective-c,uiviewcontroller,uinavigationcontroller,storyboard,autolayout
I've got an app that I used Storyboard and autolayout to lay out. I used a UINavigationViewController to programmatically transition between UIViewControllers on button pushes. I used XCode 6 with a minimum iOS version number of 7.1 (tested on iPhone 4s). I wanted to write a universal interface that would...

How to reset the Navigation Controller in Xcode 6?

ios,objective-c,iphone,uinavigationcontroller
Im working on an App for iOS, thats uses the navigationController to switch betweens views. I'm trying to return from to the root viewcontroller from the third view. I have succeeded in the Main.Storyboard, with dragging a button from third to root view, but then the NavigationController just continues the...

UISplitViewController and UINavigationController doesn't work properly with multiple storyboards

ios,uinavigationcontroller,uistoryboard,uisplitviewcontroller
I'm trying (for experiment) to work with multiple storyboards. The first storyboard (starts at startup) contains only one view controller that executes some code and download json data from a website. When finish the download task, the view controller (of first storyboard) set the entry Point of Second storyboard as...

Cannot add UIBarButtonItem to toolbar in UINavigationController

swift,uinavigationcontroller,uibarbuttonitem,uitoolbar
I have tried to add the UIBarButtonItem to the toolbar of UINavigationController, but it does not show any buttons and found that the _toolbar array is empty when I am doing debug. override func viewDidLoad() { var default_title = ["A","B"," C","D"] var items: NSArray = NSArray() for title in default_title...

Wrong animation of layer's y position when using a UINavigationController and UINavigationBar

ios,uinavigationcontroller,uinavigationbar,facebook-pop
I setup and customize the UINavigationController's nav bar in viewWillAppear: like I always do. I then have an NSTimer firing in viewDidLoad with a 0.6 time interval. This timer triggers my animation code. I'm using Facebook's POP framework and all I want to do is use the following code to...

How to implement UIViewControllerContextTransitioning compatible with interactive transitions

ios,uinavigationcontroller,uiviewanimation,uiviewanimationtransition
I am on my way to create a custom navigation controller. Indeed, I would like to have a UINavigationController with a "content view" which is not necessarily the full screen, but which can be any view. Since I also would like to use custom animations for transitions and interactive transitions,...

Why is my NSNotificationCenter throwing an exception?

ios,swift,uinavigationcontroller,nsnotification
I have a table view controller with a swipe gesture recognizer that fires NSNotificationCenter.defaultCenter().postNotificationName("DuskTheme", object: nil) whenever the user swipes up. In the viewDidLoad() function, I have the following observer: NSNotificationCenter.defaultCenter().addObserver(self, selector: "dusk:", name:"DuskTheme", object: nil) which calls the function dusk(notification: NSNotification) that changes the color of the elements on...

Navigation bar disappearing when pushed programmatically

ios,swift,uinavigationcontroller
I've been working on an app for a while now and it pushes a view controller from the AppDelegate. When it does the navigation bar that was previously on the view controller being pushed disappears. Right now it's a static nav bar (not part of a navigation controller), but it...

How to add a menu bar to a UICollectionViewController embedded in a UINavigationController?

ios,swift,uiviewcontroller,uinavigationcontroller
I have a navigation controller who's root is a Collection view controller. I'm trying to add a tab menu bar at the top just under the navigation bar and before a scrollable collection view. The tab bar would have two buttons that show the appropriate collection view. Below is the...

Load a view that is previously loaded in iOS

ios,objective-c,uiviewcontroller,uinavigationcontroller,viewcontroller
I have been searching around about this problem, but haven't got any answer yet. My problem is: I have a push button that when clicked will push to another view. Here is how I push it: ViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"Main_View"]; [self.navigationController pushViewController:vc animated:YES]; The ViewController vc is...

What method is called when UINavigationController is presented?

ios,uinavigationcontroller
I am trying to subclass the UINavigationController to add a custom subview underneath its UINavigationBar. The problem is when I set my custom UINavigationController as the rootViewController of my window, the UINavigationBar position changes, so I want to update the position of my custom view accordingly. My question is where...

iOS UI causes crash after pushing/popping second view controller

ios,objective-c,user-interface,uinavigationcontroller
In my iOS app, the entire user interface is coded programmatically, meaning no xibs or storyboards. All works well until I add another view controller via a UINavigationController. The first view controller works well, and when the second view controller is pushed, it works well too. But after the second...

Root child view not sized properly when displayed by navigation controller

ios,xcode,uiview,uinavigationcontroller,interface-builder
I have a root view in a navigation controller that isn't conforming to the right length and I don't know how to fix it using IB. Here is a short clip showing what's happening (the attributes inspector shown in the video are of the navigation controller connected to this issue)....

Shared iAd banner unloads ad after dismissing navigation popover

ios,objective-c,uiviewcontroller,uinavigationcontroller,iad
I saw a few other similar questions but could find any answers... I have a shared iAd banner. The problem is when I load it in a modally presented NavigationController with a TableViewController, when I dismiss the TableViewController the Ad Banner in the MainViewController loses the ad and I receive...

Navigation Controller : What is below the topmost view controller in navigation controller on the window?

ios,uinavigationcontroller
What is below the topmost view controller in navigation controller on the window? (Is it the 'navigation controller' or 'the view controller below the top view controller' in the navigation stack?) OR Are all the view controllers present on the phone window simultaneously one below the other on the navigation...

White bottom bar appears after pushing EKEventViewController on Navigation Controller and returning

ios,ios8,uinavigationcontroller,ekevent
I'm developing an app displaying a table of events that are fetched from the iOS Calendar. When a row in the table is clicked, I want to display the event info using an EKEventViewController. Here is what the table of events look like: When an event in this list is...

Dismiss a Modal UINavigation Controller

ios,swift,uiviewcontroller,uinavigationcontroller,modalviewcontroller
I have a UIViewController (a) which is the root view controller in a UINavigationController (b). The UINavigationController is displayed modally (via a segue) from another UIViewController (c) that is completely separate. The issue I'm having is that when I try to dismiss the modally displayed vc (a) I get a...

Queuing ViewControllers to be Pushed One By One

ios,objective-c,swift,uiviewcontroller,uinavigationcontroller
How do we "queue" ViewControllers to be pushed one by one? My app check for number of "Friend Requests" and I would like to push one by one from one to another. Check for Requests Found 3 Requests Push FriendRequestViewController User Press OK Push Another FriendRequestViewController User Press OK Push...

what is the logic in pushing among Views?

objective-c,uiviewcontroller,uinavigationcontroller
I am new to iOS, I have a question about the view. Lets say I have ViewOne, ViewTwo, ViewThree, ViewFour. I push the scene accordingly: ViewOne -> ViewTwo -> ViewThree -> ViewFour. How can I programmatically jump back to ViewTwo dirrectly? What is the logic for this? Please advice.

Storyboard : Pop to root view controller from subview

ios,objective-c,iphone,uinavigationcontroller,storyboard
this is my first app so this should be simple for experienced ios developer. I have a story board with navigation controller and in one of my view controller there is a subview. On click in subview, I want to return to the root controller but unfortunately it is not...

Swift NSNotification not working for all ViewControllers

ios,swift,uinavigationcontroller,nsnotificationcenter,viewdidload
In this Navigation Controller App, I have a button in the TAN ViewController that when clicked on posts an NSNotification. -Both the Blue (Root) ViewController and the Green ViewController are listening to this same notification -The Blue ViewController successfully responds to the notification's arrival -The Green ViewController DOES NOT respond...

How to restrict UISearchController from hiding view Navigation Bar in IOS8

ios8,uinavigationcontroller,uisearchcontroller
I have a UIViewController embedded in a popover. This controller has two subviews, a UINavigationBar and a MapView. I try to implement the new search Controller i.e. UISearchController as UISearchDisplayController is deprecated in iOS8. When I click in the search bar (displaying two scopes), everything is all right, and the...

Pop to previous UINavigationController

ios,objective-c,uinavigationcontroller
I have two UINavigationControllers like this: LoginNavigationController -> LoginView HomeNavigationController -> HomeView -> ... From LoginView I navigate to HomeView like this: [self presentViewController:HomeNavigationController animated:YES completion:nil]; Now when app goes to background I need to go to LoginView. What is the right way to do this? Will redirecting with presentViewController...

How the detail view controller told the main controller about the changes made?

object,uinavigationcontroller
I'm reading the Big Nerd Ranch book and I'm at the 10th chapter about the navigation controller. In the main controller, there is a TableView ( https://github.com/bignerdranch/iOS3eSolutions/blob/master/11.%20Homepwner/Homepwner/Homepwner/ItemsViewController.m ) where there are two methods that interact with the detail view : - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [[self tableView] reloadData]; } -...

Back button in UITableView

ios,objective-c,xcode,uitableview,uinavigationcontroller
Is there any way to add back button in UITableView ? I have two tables view when you select cell from first table you will be moved to another table. However, when I moved to second table I can't go back to the first table. Here is the example :...

Customise the navigation bar background for a single view in Swift?

ios,swift,uinavigationcontroller
I have an app with multiple views and controllers but on just one of those views I would like to make the top navigation bar transparent with white text. I have the following code in the controller for said view: override func viewDidLoad() { super.viewDidLoad() let bar:UINavigationBar! = self.navigationController?.navigationBar bar.tintColor...

EXC_BAD_ACCESS when using UIPageControl in navigation bar

ios,objective-c,uinavigationcontroller,uinavigationbar,uipagecontrol
When i first click on the UITabBarItem "Tabeller" this view is presented: And after selecting any of the rows this view is presented: What i am trying to achieve is to display the PageControl in the Navigationbar. It works and all BUT i am getting a weird crash in this...

Changing the Navigation Bar in Swift

ios,swift,uinavigationcontroller,uinavigationbar
I would simply like to know how to make my navigation bar look like the one on the left in the image below: My app uses a navigation controller, and the navigation bar by default looks like the screen on the right in the image. I don't like it being...

navigationcontroller back to upper navigationcontroller

ios,uinavigationcontroller
The question is show in the picture. How can I back from viewcontroller C to A. Method popViewControllerAnimated doesn't work. ...

Creation of ViewControllers by the storyboard vs. by alloc/init

objective-c,uiviewcontroller,ios8,uinavigationcontroller,uistoryboard
I'm using Xcode 6.3, Objective-C. In my storyboard, I create a UINavigationController. I then create a UIViewController and assign it as the root controller of the UINavigationController. I then create a second UIViewController, and connect it to the first UIViewController with a "manual show" segue. So my storyboard has a...

iOS8 behavior on nested navigation controllers

ios,uinavigationcontroller,uitabbarcontroller,uisplitviewcontroller
My app has a top level navigation controller. It navigates between different pages and displays a navigation panel on top, as usual. One of those pages is a tab controller with 3 tabs. Each tab has its own navigation controllers because while being in a tab I need to open...

How can I get the view that current view is transmiited from that

ios,objective-c,uiviewcontroller,uinavigationcontroller,uiwindow
I use below code to transmit from my mainViewController to another UIViewController: UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:otherUiViewController]; UIWindow *window = [UIApplication sharedApplication].keyWindow; [UIView transitionFromView:window.rootViewController.view toView:navigationController.view duration:1.2f options:UIViewAnimationOptionTransitionFlipFromLeft completion:^(BOOL finished){ window.rootViewController = navigationController; }]; at...

Navigating to new UINavigationController

ios,swift,uiviewcontroller,uinavigationcontroller
I'm new to the world of iOS and I'm trying to build a simple app in Swift. I have a navigation controller linked to a LoginViewController (the login screen). The login screen has a button linked to a RegisterViewController. From the login screen the user can press the "Register" button...

searchbar changes color when in navigation bar

ios,uinavigationcontroller,uisearchbar
I added a search bar in the titleview of a navigationitem. Searching works properly, but when using the navigation controller, the background of the searchbar changes colors, as seen below The only place that I touch color is to change the color of the navigation item in the storyboard via...

Questions about navigation bar

ios,swift,uinavigationcontroller
I am confused about the relationship of navigation controller and content view controllers. In storyboard, navigation bar is under the navigation controller, so I linked it to the NavigationController class and then customized the navigation bar in the viewDidLoad function. However, since different content views will have different navigation...

Tab bar item not showing

ios,swift,uinavigationcontroller,uitabbarcontroller
if(!isUserLoggedIn){ var loginViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("loginView") as! LoginViewController window!.rootViewController = loginViewController window!.makeKeyAndVisible() }else{ var mainViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("mainView") as! FirstViewController var myDealsViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("myDealsViewController") as!MyDealsViewController var settingsViewController =...

Issue with a UINavigationController inside a UITabBarController inside another UINavigationController

ios,cocoa-touch,uinavigationcontroller,uikit,uitabbarcontroller
Don't ask me to show the code because there's no code. Everything has been done in a storyboard. My app starts with a main navigation controller which holds a login view controller as its root view controller. The login view controller has a button. When the button is pressed a...

Reset hidesBarsOnSwipe in swift

swift,uinavigationcontroller
Where and how do I have to reset hidesBarsOnSwipe? I set the option in a View Controller which I push and want to reset it for the View Controller which did the push. What I tried until now is setting hidesBarsOnSwipe to false in the viewDidDisappear and in the viewDidLoad...

Is there a reason for the huge Navigation Controller icons in Storyboard?

ios,xcode,uinavigationcontroller,uistoryboard
I've got six VCs at this point in my app. Is there some reason I also need six huge Navigation Controllers? I've never used them (the NC icons) in my development schemes to this point. Here's what my storyboard looks like: I'd much prefer to have all that wasted real...

How to determine, in an app with several ViewControllers attached to NavigationControllers, what the currently displayed View is?

objective-c,uiviewcontroller,ios8,uinavigationcontroller,uitabbarcontroller
I have an iOS 8 app, built with Objective-C, with a TabBarController, with 3 tabs. Each Tab links to a NavigationController (so there are 3 NavigationControllers), and each NavigationController has a stack with several ViewControllers in it. So, at any given time, the app's user can be on, say, ViewController...

Adding progress bar under navigation bar in swift?

ios,swift,uinavigationcontroller,uinavigationbar,uiprogressview
Say me please how to add a ProgressView under navigation bar? I try to use solution in this post: adding progress bar under navigation bar, but there code was written on ObjectiveC language... I try to translate to Swift. This is the code, which i added in my NavigationController SubClass...

Save changes when tapping Back - Swift

ios,swift,uinavigationcontroller,master-detail
I have a Master Detail storyboard set up with a Navigation Controller. The Master view being a UITableView that shows a list of things saved using Core Data. When a row is tapped, it segues to a Detail view which has a UITextView where you can edit the data. How...

Swift – Instantiating a navigation controller without storyboards in App Delegate

ios,objective-c,swift,uinavigationcontroller,appdelegate
I'm rebuilding an app without storyboards and the part of it that I'm having the most trouble with is navigating view-to-view programatically. Few things are written out there which don't use storyboards, so finding an answer for this has been tough. My problem is pretty simple. I have my ViewController...

Whitespace at the top of a UIViewController [duplicate]

ios,uiviewcontroller,uinavigationcontroller,storyboard,uitextview
This question already has an answer here: Blank space at top of UITextView in iOS 7 9 answers I have a UIViewController embedded in a UINavigationController. The UIViewController contains a UITextView (which takes up the entire screen except for the nav bar and menu area. For some reason there...

swift - navigation controller remove back button arrow

ios,xcode,swift,uinavigationcontroller,uiimage
I have an application in swift, where the view controllers are inbedded in a navigation controller, now in the 2nd and 3rd viewcontroller, on the back button, there is a blue arrow pointing backwards (it is there by default). I have tried to remove this, but when I want to...

Adding an array of UIBarButtonItem resulting in an Error

ios,objective-c,xcode,uinavigationcontroller,uibarbuttonitem
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI isSystemItem]: unrecognized selector sent to instance 0x7fa5bbd726f0' I have followed his solution here, and apparently I am doing no flaw. What I am doing is - adding two buttons(bar buttons) on the right side of my navigation bar. UIBarButtonItem *notificationButtonItem...

Navigation bar not showing

ios,objective-c,uinavigationcontroller,navigationbar
Here I have 2 views: WelcomeVC WebViewVC First AppDelegate calls WelcomeVC through this code below: - (void)presentWelcomeViewController WelcomeViewController *welcomeViewController = [[WelcomeViewController alloc] initWithNibName:@"WelcomeViewController" bundle:nil]; welcomeViewController.title = @"Welcome to My App"; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:welcomeViewController]; navController.navigationBarHidden = YES; self.viewController = navController;...

What is the return value of navigationControllerSupportedInterfaceOrientations in Swift?

ios,swift,interface,uinavigationcontroller
It is a delegate method of UINavigationControllerDelegate. The return value in Swift and Objective-C is different. see: Obj-C: - (NSUInteger)navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController Swift func navigationControllerSupportedInterfaceOrientations(_ navigationController: UINavigationController) -> Int When i use objective-c, it works fine. However, when i use Swift, i cannot return correct value in the method. See the...

NavigationBar not loading when ViewController is programatically presented

ios,objective-c,uinavigationcontroller,uinavigationbar,viewcontroller
I am attempting to load one navigation controller (BasicSearchController) from another (ViewController). In Storyboard, I have created 2 Navigation Controllers, which are not linked by segues, but are separate Nagivation controllers. Each is linked to ViewController and BasicSearchController respectively, and each view controller has its own title text in the...

Full screen horizontally scrolling UICollectionView cells shift downwards when used in first displayed UIViewController

ios,uinavigationcontroller,uicollectionview,uicollectionviewcell,uicollectionviewlayout
I'm creating a series of help pages that display when the user first starts the app. To do this, I have a programatically set up UIViewController that initializes a (programatically set up) UICollectionView the size of the view controller bounds. Each cell contains a fullscreen sized image. When this view...

Add UINavigationController to navigation stack

ios,objective-c,uinavigationcontroller,rootview
I have two UINavigationControllers like this: LoginNavigationController -> LoginView HomeNavigationController -> HomeView -> ... From LoginView I navigate to HomeView modally like this: [self presentViewController:HomeNavigationController animated:YES completion:nil]; When the app goes to background I use an observer in LoginView that dismisses HomeNavigationController. There is a case though, in which I...

Refresh the main page when back button is pressed through navigation controller ios

ios,objective-c,uinavigationcontroller
I have a main page which when clicked takes me to another page through navigation controller.I do some operations in then press the main page navigation bar which takes me back to the main page but the problem is the main page doesn't get refreshed.No function are called not even...

pushviewcontroller with zoom animation like ios photo app

ios,uinavigationcontroller,pushviewcontroller
I've two UIViewControllers. My first UIViewController shows various video thumbnails, photos and notes. And second controller is resposible for showing the selected video, photo or note in previous controller. I've also a UICollectionView in my first controller which lists everything just like Apple's Photo App in iOS. I use "pushviewcontroller"...

How to get the RootViewController from a UITabBarItem

ios,objective-c,uitableview,uinavigationcontroller,uitabbarcontroller
Im not even sure if the title is correct but i do not understand how else to explain it so here it goes. I will show you in steps what i do so you will understand. First off , i am using UITabBarController where i got three different items. 1)...

Status bar sized incorrectly with a contained UINavigationController

ios,uiviewcontroller,uinavigationcontroller,statusbar
I make a UINavigationController a child of another view controller through containment. Everything works fine, except for a strange issue that occurs when launching the app with the in-call status bar turned ON and then switching it back OFF after the app UI is on the screen. There appears a...

How to push viewcontroller onto navigation stack using Swift?

ios,swift,uiviewcontroller,uinavigationcontroller
I have a NavigationViewcontroller set up before a UIViewController, I want to perform a segue programmatically and push another Viewcontroller onto the navigation stack. How can I achieve this? class CreateEventViewController: UIViewController, CLLocationManagerDelegate { // Updated post with simple answer // If you have a Naviagation Controller already instantiated then...

iOS: Go back to entry point view controller which is not part of navigation controller

ios,uinavigationcontroller,swrevealviewcontroller
I have a login view controller which is outside my navigation controller. When a user logs out, I want them to be back to the login view controller. I am using SWRevealViewController and Storyboards. User Flow: -> Login View Controller -> SWRevealViewController-> UINavigationController...

UITabBarController Header with Title

ios,uinavigationcontroller,uitabbarcontroller,uinavigationbar
I have been trying to hours to implement a simple UITabBarController where each view (or tab) has an active header (or top bar) with the title of the view. Is there a way in Xcode 6.1.x to create a UITabBarController with pages whose title is reflected in the top bar?...

self.navigationController.navigationBar.translucent = NO; create an extra gap after navigationBar

ios,objective-c,uinavigationcontroller,uinavigationbar
Let me explain my situation first. I set the UINavigationBar color in my appDelegate Like: [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:255.0f/255.0f green:87.0f/255.0f blue:10.0f/255.0f alpha:1]]; Now in my some viewController the translucent of UINavigationBar set as YES. self.navigationController.navigationBar.translucent = YES; That's why there is a shade over my UINavigationBar. It wasn't showing the...

Adding a title to the left side of the navigation bar

ios,xcode,swift,uinavigationcontroller,navigationbar
Is it possible to add a title to the left side of the navigation bar? I know how I can add a title in the center but when I try to add one to the left side I see nothing. This is the code I have: self.navigationItem.leftBarButtonItem?.title = "Elapsed Time:...

Creating a navigationController programatically (Swift)

ios,swift,uinavigationcontroller
I've been trying to redo the work on my app programatically. (Without the use of storyboards) I'm almost done, except making the navigation controller manually. I've been doing some research but I can't find any documentation of implementing this manually. (I started making the app as a Single View Application)...

Auto Rotation iOS 8 Navigation Controller

objective-c,iphone,ios8,uinavigationcontroller,autorotate
I have certain viewControllers which are managed by a UINavigationController (push and pop). I want to restrict different viewControllers to different orientations like the first one should be only in Portrait, second in portrait, third in landscape and fourth can be portrait and landscape both. I set a ViewController on...

How to add another UIViewController to an existing UINavigationController

ios,objective-c,uiviewcontroller,uinavigationcontroller
I have an app with two View Controllers. The first one is embedded in a Navigation Controller and has a navigation bar, I present the second View Controller programatically after a certain method has ended in the first View Controller. This works fine, but this way the second View Controller...

view with navigationController over tabBarController [duplicate]

ios,swift,uinavigationcontroller,uitabbarcontroller
This question is an exact duplicate of: IOS pushViewController without tabBar and navigationBar 2 answers How I can open new view over UITabBar and with working UINavigationController? self.navigationController?.pushViewController(view, animated: true) Example: ...

Get currentViewController of View Controller in UITabBarController in UINavigation Controller

ios,objective-c,uinavigationcontroller,uitabbarcontroller,appdelegate
I would like to know how I can find the current view controller if I have a UITabBarController and within that TabBarController I have 4 different UINavigationControllers and then that NavigationController obviously has the stack of view controllers. In my app delegate I am trying to find out this information...

How do I access a view controller from AppDelegate.m during a background refresh

ios,uinavigationcontroller
I am trying to implement background refresh in my app. I have a method refreshMessages that is inside one of my UIViewControllers (I am using a UINavigationController). I need to access this controller from AppDelegate.m. Usually I would do something like this: UINavigationController *navigationController = [self.window.rootViewController navigationController]; to get the...

UISplitViewController's detail view push error

ios,iphone,uinavigationcontroller,uinavigationbar,uisplitviewcontroller
I'm implementing a universal app using UISplitViewController for iOS8 and facing strange problem with the UINavigation and would really appreciate your expertise. My project has the following StoryBoard layout: On iPad, everything is working as expected. However, running on the iPhone, the navigation doesn't work as expected. Please see this...

UINavigationController hides back button only on second appearance of view

ios,iphone,swift,uinavigationcontroller,back
I have three view controllers: A login view, a home tableview screen, and a detail tableview screen. These are all part of the same UINavigationController. On the home screen, I want to disable the back button, preventing a user from backing into the login screen. So in the viewDidLoad() function...

how to check if controller is already on navigationcontroller viewcontrollers stack?

ios,swift,uinavigationcontroller,uitabbar
i'm getting this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same view controller instance more than once is not supported How does one check if a controller already exists in the stack and not push that controller but move to it? Here's some code where I'm...

How to present a view controller inside a navigation controller SWIFT

swift,uiviewcontroller,uinavigationcontroller
I have VC1 which is a basic view controller, I then want to present VC2 which is inside a navigation controller. Whenever I present it, it doesn't display the navigation controller. I want this all done pragmatically. The code I have been using to present VC2 is: func matchesPressed(sender: UIButton!)...

Could not cast value of type 'UINavigationController' (0x10836e698) to 'UITabBarController' (0x10836e6e8).?

xcode,swift,uiviewcontroller,uinavigationcontroller,uitabbarcontroller
This is the code for UITabBarController in which I am trying to open a splitviewcontroller. import UIKit class SecondViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) ///here after this line I am getting error var mainCont : UITabBarController = ((UIApplication.sharedApplication().delegate) as! AppDelegate).window?.rootViewController as!...

Creating a visual storyboard based upon app delagate using custom class for Navigation Controller

ios,objective-c,iphone,swift,uinavigationcontroller
Edit: How to I add a login View Controller in this repository: https://github.com/gazolla/MapTable-Swift I want to take what is in AppDelagate and create it visually with storyboard so that it 1) Isn't called immediately when I compile the code and 2) So I can make everything else with the storyboard...

Programmatically Setting UINavigation Bar Button

ios,swift,uinavigationcontroller
How can I set the UINavigation Bar Button to a particular image programmatically using Swift??

nav bar nonresponsive after UIImagePickerController dismissed

ios7,uinavigationcontroller,uinavigationbar,uiimagepickercontroller
On iOS 7 only, the navigation bar in my app does not respond to any touches after a UIImagePickerController is used and then dismissed (whether a pic has been selected or not). The screen below the navigation bar functions as normal, but it is now impossible to navigate Back in...

UINavigation Bar to turn transparent as user navigates deeper

ios,objective-c,swift,uinavigationcontroller,uinavigationbar
In many apps nowadays it's quite popular that some views (Profile Pages or so) in a NavigationController have a transparent Navigation Bar. You can see what i mean in the mockup. I'm trying to accomplish this effect but I'm having a tough time trying to figure out how to do...

UINavigationBar not showing, tried multiple fixes

ios,iphone,xcode,uinavigationcontroller
This is really frustrating because no matter anything I do my Navigation Title will not appear at all. The view is even the root controller for the navigation I have tried the following: Checking the box "Shows Navigation Bar" in Interface Builder. Using the Simulated Metrics for a Navigation bar....

How do you assign an IBOutlet programmatically using Swift?

ios,swift,uinavigationcontroller,uibarbuttonitem
I added a bar button item programmatically to a view controller: override func viewDidLoad() { super.viewDidLoad() self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Menu", style: .Plain, target: nil, action: nil) } Now I want to assign that bar button item to an IBOutlet programmatically. How would I do that using Swift?...