How to completely remove back button from navigation bar? - ios

For some reason I'm adding left and right buttons to the navigation bar as its subview instead of using navigation item. When pushing a view controller, I'm setting its navigationItem.hidesBackButton to YES so that the ugly looking blue 'back' button will not show up. The problem I'm facing is that, after tapping my own back button, while the currently showing view controller being popped --- I mean during the animation of the 'pop', I can see a '...' in the navigation bar moving right along with the popped view controller. And, I DON'T want that '...' to appear for even 0.0000000001 second. What may I do now? Any hint would be appreciated.

Note:Problem solved with just comment. But posting this as answer so that It will help someone else having same issue.
I too had same problem with navigationBarButtonItem while adding custom barButtonItem to navigationBar in storyboard. If you are also using storyboard then just set navigationBar tint color as clear color in navigationController. By setting clear color, that weird default navigation back button will not appear anymore.

Related

How can I remove the gap on top of the navigation bar?

The gap is somehow conected to the back function. If I pull down the navigation bar the app returns to the last view, but I don't want the option to go back a view.
I don't know where to search for it.
if the picture doesn't work. Here is the Link: https://www.dropbox.com/s/3tse4oehn6o47bw/IMG_9159.PNG?dl=0
Try setting the UIViewController's modalPresentationStyle property to .fullScreen.
https://developer.apple.com/documentation/uikit/uiviewcontroller/1621355-modalpresentationstyle

Navigation bar changes height after segue

I have an issue with my app that I can't solve. I have a FirstViewController with a button. when this button is pressed a SecondViewController is pushed. The issue is that the navigation bar changes its height in the secondViewController like (GIF above)
I didn't write code related to the navigation bar, I checked everything I could think about and tried to delete the segue and re-add it. How can I solve that?
The only thing I found is this answer but it didn't work for me
It looks like it is making space for a 'prompt' message that appears above the navigation bar as your GIF shows. As you've said you haven't added any code also check the storyboard in case you have entered just a space (as we obviously can't see any text) in the navigation bar prompt box as shown below. Click navigation bar in your view and look at the inspector:
If there is obviously no space, add text and re-delete it.

iOS Swift: Incorrect Navigation Bar Appearing

The incorrect navigation bar is appearing on my Table View Controller screen (see Storyboard Below).
I would like what's displayed on the storyboard to be my navigation bar (i.e. with "Main Feed" title and Sign Out button on the top right). However, this is what I'm actually getting -
There are two issues here: 1) The incorrect navigation bar is displaying (this one has a login back button); 2) the first few table view cells are placed underneath the nav bar vs. under it.
This happened after I embedded the Table View controller in the Tab Bar Controller. I want a bottom tab bar in the main portion of my application hence the reason why I added the Tab Bar Controller. Any suggestions on how to fix this? Rather than using the Tab Bar Controller in storyboard, is there a way to do this programatically? Thanks!
The navigation bar that you are seeing on top of the stack is the navigation bar from the UITabBarController itself, that is why you are seeing the back button show "login". There's a few ways to work around this, programmatically:
When you initialize the UITabBarController, set it's navigationController's navigation bar property to "hidden"
Go through each view controller form the beginning of your app up to where you first see this problem and in the "init" method of the viewController you are testing, set the navigationbar to hidden. Something like, self.navigationController?.navigationBar.hidden = true;
This is how you can "debug" this issue, but it's going to take some tweaking to get it right.

How to get rid of the glitch that occurs right after pressing the back button?

A strange glitch happens when I press the back button.
The glitch happens during the transition from the actual View Controller to
the previous view controller.
A portion of another view controller appears for a brief moment between the
search bar and the first cell, and then it disappear.
(The black rectangle in the screen shots)
here are some screen shots and a link to a side project where I recreated
the problem.
Link to the project : https://www.dropbox.com/sh/ak5mckhrysychlr/AACQd2Mwh5RxklmD1dv738h1a?dl=0
you are using opaque navigation bar in some view controllers and translucent in some,that's y it's causing the issue,Change the navigation controller to Translucent
Change your UINavigationController to Translucent and this issue will be fixed.
self.navigationController.navigationBar.translucent = YES;

Xcode - replace navigation bar with toolbar on show segue

This is what I wish to do.
---- Segue : show ---->
on the destination page, I want to hide the tab bar from the previous page and show the toolbar instead.
When I check "Hide bottom bar on push" on storyboard, the tool bar on the destination page disappears as well.
I think you should change the title of your question since you want to replace the tabBar with a toolBar and keep the navigationBar. At leas this is what I understand from your sketch.
As for the question, have you tried hiding the tabBar in viewWillDisappear in your first view?

Resources