1,148 questions
0
votes
3
answers
304
views
Remove the back button text
Currently trying to remove the title of the previous VC on the back button. Following apple's documentation I have used:
let backBarButtton = UIBarButtonItem(title: "", style: .plain, target: nil, ...
-1
votes
1
answer
354
views
Changing leftBarButtonItem position. It is far from the border
I have a UIButton
let leftButton = UIBarButtonItem(image: UIImage(named: "draggerMore.png"), style: .plain, target: self, action: #selector(crossBtnTapped))
and I set it as leftBarButtonItem
self....
0
votes
1
answer
725
views
Buttons replacing navigation bar items
I want to get two buttons under status bar:
First, I hided navigationBar:
navigationController?.setNavigationBarHidden(true, animated: false)
and made 2 buttons on the place of NavigationBar. It ...
0
votes
0
answers
125
views
Search bar behavior inside Navigation Bar is inconsistent in iOS 13
I am trying to include search bar inside the navigation bar through navigation item of the view controller.
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = ....
0
votes
0
answers
39
views
UIActivityIndicator view on navigation left bar button item doesn't show for iOS 13.0 device?
UIActivityIndicator view on navigation left bar button item doesn't show for iOS 13.0 device:
Here is the code:
let activityIndicator = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 20, ...
0
votes
0
answers
48
views
How do I change/reset NavBarItem programatically without reloading VC? [Swift]
This one is driving me crazy. I'm trying to change the RightBarButton from a function within the owning view controller (For more info, this is my structure: TabBarController > Navigation Controller > ...
0
votes
1
answer
40
views
How can I make navigationItem.backbarbuttonitem different from the title of the previous view's navigationItem?
I have a navigationItem on a ViewController and I want it to have it's own title and back button, but the documentation says that the only way to set the backButton's title is to change the title of ...
0
votes
0
answers
301
views
UINavigationBar button clipped
I'm testing custom button for embedded navigation bar, but when passing to a second VC buttons (or when I go back from second to first) seem to have a sort of "clipping" on top and bottom side I ...
0
votes
1
answer
156
views
Swift Scroll down should make Bar Item disappear
I want that the Bar Button Item diappear when I scroll down. My problem is that I don't know how to detect the scroll? I have tried some code but nothing worked. For example:
func scrollViewDidScroll(...
0
votes
2
answers
163
views
(Swift) Navigation bar is hidden in viewController
I want to present SecondVC from FirstVC and make SecondVC have a rightBarButtonItem called Close which calls an @objc function which dismisses SecondVC.
Also, I want to change secondVC's title from ...
0
votes
1
answer
619
views
iOS navigation bar custom titleView subviews are not showing properly
iOS navigation bar custom titleView subviews are not showing properly when the parent viewController pushed from another view controller.
Custom Title view in root view
Custom Title view in View ...
0
votes
1
answer
61
views
NavigationBar Right Button is not Appearing
I assigned Custom Class to navigationbar but right button is not appearing on navbar.
Here is the code if anyone can help will be appreciated.
class BaseNavigationController: UINavigationController {
...
6
votes
0
answers
341
views
NavigationItem hidesSearchBarWhenScrolling not working from child view controller with table view inside of horizontal page controller
So I have the following layout:
UIViewController
UISegmentControl
UIPageViewControllerContainerUIView
3 ViewControllers with table view inside as child view controllers for page controller
...
0
votes
3
answers
789
views
titleView of Navigation item moved to the left?
I have an app with a left (hamburger) navigationItem.leftBarButtonItem and we've set the titleView to the logo of the company. The problem is that they want the logo next to the hamburger. The ...
3
votes
2
answers
3k
views
SwiftUI How to add action on UIBarButtonItem?
I am using SwiftUI and I have added Button in NavigationBar but I am unable to set action on that button. I tried these two approaches but failed.
Approach:1
.navigationBarTitle("\(task.label)")
....
0
votes
0
answers
52
views
UINavigationItem backBarButtonItem issue during screen transition
I have UINavigationController with 2 view controllers vc1 and vc2 (vc1 pushes vc2). I need to set back button title of vc2, so I do it by:
vc1.navigationItem.backBarButtonItem
= ...
1
vote
5
answers
601
views
Swift navigation bar - remove left bar item
I want to remove back-button which takes me to previous VC. Is solution in changing rootVC or?
I have LoginVC and HomeVC. If user successfully logs in, he shouldn't have an option to go back to login ...
6
votes
2
answers
1k
views
searchBar missing from view hierarchy in iOS 12
I have a UISearchController with searchBar assigned to my view controller's navigation item. All works fine in iOS 13.3. However, in iOS 12.4, the searchBar is missing and appears not have been added ...
1
vote
1
answer
881
views
Padding wrong when presenting second modal navigation controller on iOS 13
On iOS 13, when presenting a second modal view controller over a first one, the padding is incorrect on the button bar items. In particular, the right margin disappears.
How should this be fixed?
3
votes
0
answers
45
views
Navigation bar storing property of the popped view controller
setNavigationBarWithBack(success: {
self.createGroup()
}
}, name: "CREATE GROUP", rightSideImage: "nextIcon")
This is my extension call to create a navbar with a back button and a ...
0
votes
2
answers
149
views
Access navigationItem.title from another class Swift
How can I access a title inside the navigation controller from a separate Class? I embedded my mainVC into the navigation controller via Storyboard. I can access the title from inside the viewDidLoad ...
4
votes
1
answer
4k
views
Get position of navigation bar item button in Swift
I want to get position(point) of my navigation item which is a button. If I can get this point I will be able to add a guide circle on my app. But I can't get this point right.
let point = ...
0
votes
0
answers
80
views
Reload BarButtonItem after pressing (Change formatted string title)
I have added a bar button item programmatically that will change the temperature units on some variables between Celsius and Fahrenheit and have set it with attributed text via a customView.
It is ...
-1
votes
2
answers
278
views
UINavigationBar titleTextAttributes - not applied during transitions
I have give my nav bar titles a larger font like this:
let navBarTitleTextAttributes = [
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 24.0, weight: .black)
]
UINavigationBar.appearance()...
0
votes
4
answers
1k
views
How do I hide my Searchbar when scrolling?
My SearchController has unintended behaviour of showing up translucent on top of my scrolling content:
Ideally, I want it to scroll up with my content and the navigation bar to collapse.
Any tips on ...
35
votes
6
answers
12k
views
UIViewControllerRepresentable: Navigation Title and Bar Button Items Ignored in NavigationView
I have a UITableViewController subclass that I have wrapped in UIViewControllerRepresentable.
I have set the navigationItem.title and navigationItem.leftBarButtonItems in my view controller.
I present ...
0
votes
2
answers
1k
views
Unable to get UIView/Frame of navigationItem.rightBarButtonItem - iOS
My application in Swift 5 have a navigationItem displayed at top right corner using
override public func viewDidLoad() {
super.viewDidLoad()
var deleteNavBarItem = UIBarButtonItem.init(...
0
votes
1
answer
87
views
How to change navigation item title with "username"?
I want to change my controller's navigation item title with username. I am using JSON data struct for user information (username, userid, etc..) and I write a method Code like below but it isn't ...
0
votes
0
answers
337
views
NavigationBar button not clickable iOS13
I have a problem with my navigationbar. I go to the "audio" viewcontroller, if I go back, I can't click on my navigationbar button menu and "?".
I test on an iOS 10, iOS 11 and iOS 12 device on ...
2
votes
1
answer
278
views
Possible iOS13 or Xcode bug with new ViewController Presentation Style
I'm having an issue with the margin of a right NavigationBarButton.
I've distilled this down to a fresh single-view project in Xcode 11. I have a launch screen storyboard and a main storyboard.
The ...
0
votes
1
answer
73
views
Changing custom UINavigationBar attributes not working completely swift
I'm changing the default navigation bar for a custom navigationBar, to set a custom localised title but I'm not able to change it's title color nor the back button as I normally do. Can you see what I'...
0
votes
1
answer
93
views
How do I get a back button in pushed ViewController (Xcode)
I have a viewController with a menu button set as navigationItem like this:
self.navigationItem.setLeftBarButton(leftButton, animated: false).
It brings up a drawer menu, which is fine in its ...
0
votes
1
answer
348
views
Is it possible to add a left bar button item with multiple lines of text
I would like to add a label in the left bar button item with multiple lines of text. the height of the navigation bar will be changed according to the height of the label.
0
votes
1
answer
187
views
Wrong alignment of navigation bar button for second view controller in iOS 13
I am adding a button using the storyboard as below screenshot:
While presenting from 1st controller to 2nd controller, navigation bar button alignment is not displaying properly.
I don't know whether ...
1
vote
1
answer
55
views
How to change NavController's Backbutton-tintColor in Combination with SearchController in iOS13
As for iOS13.0 and iOS13.1, I can see a difference in behaviour when using a SearchController:
-> in iOS12.x, the BackButton is correct in Yellow
-> in iOS13.0, the BackButton is correct in Yellow
-...
1
vote
2
answers
1k
views
Font on Back Button on NavBar (Swift)
I can adjust all the other aspects of the appearance of my navigation bar - but the font of 'Back' remains stubborn.
The MWE below shows four things I have tried to no avail
1)
func ...
-1
votes
1
answer
360
views
Multiple Modally Presented (page sheet) ViewControllers Navigation Item Bug
iOS 13. The problem is shown on the screenshot.
The steps are:
Open one view controller modally with page sheet style.
Open another (second) view controller modally with page sheet style.
Expected: ...
2
votes
1
answer
139
views
iOS 13 UINavigationBar does not automatically calculate size when UINavigationItem changes
There is a problem when you try changing UINavigationItem (in my case it is setting searchViewController) after the view was loaded: UINavigationBar does not change it's size to fit the new content. ...
14
votes
1
answer
3k
views
How to line break long large title in iOS 13?
As title, is there a way to split long large titles in UINavigationBar?
I tried all those methods, working for iOS 11 but none of them seem work to me on iOS 13
How to set multi line Large title in ...
5
votes
2
answers
6k
views
Dynamically Change iOS Nav Bar Color (Dark Mode)
I'm trying to implement a toggle for dark mode in my app - this would involve toggling the nav bar color to black when the UIViewController is already visible on the screen. I'm aware of how to do ...
0
votes
0
answers
159
views
Setting UINavigationItem rightBarButtonItems when pushing a viewcontroller into a navigation stack
Just like the title says, I'm trying to replace the rightBarButtonItems for a view controller when pushing a new controller using the navigation view controller. Weirdly, sometimes this works just ...
1
vote
1
answer
85
views
Custom back button has extra unwanted space
I'm developing a Xamarin.iOS application with two supported languages i.e. English and Arabic. I want to use a custom back button. The button is placed in the navigation bar, however, it has some ...
17
votes
8
answers
9k
views
How to initally hide searchbar in Navigation controller on iOS 13?
In iOS 13 the behavior has changed so that by default when Navigation controller appears the search bar is visible (when UISearchController is assigned to a navigationItem.searchController). Some ...
1
vote
1
answer
78
views
How to update a UINavigationItem based on UITableViewCell taps?
I am creating a Quiz app where each quiz question is a grouped TableView with each cell being an answer choice, and is embedded in a navigation controller. For each right answer a user taps, I want ...
1
vote
0
answers
318
views
How to redraw NavigationBar to show SearchController on button press?
I am using a button in my navigationItem.title, which when pressed, I would like to display the navigationItem.searchController.
When cancel is pressed on the search bar, I would like to dismiss the ...
0
votes
2
answers
947
views
rightBarButtonItem appearing in the middle
The rightbarbuttonitem is not appearing on the right side of the navigation bar. I want the navigation bar to look similar to the one in the "App Store"
I have tried doing this in the storyboard and ...
3
votes
2
answers
2k
views
How can I completely override the navbar's back button action?
Basically my issue is that I'm trying to create a drawer since iOS/Swift doesn't seem to have a native object for this. For reasons I can't recall, I decided to go with a navigation controller for ...
2
votes
1
answer
708
views
iOS - Navigation bar does not show large titles when orientation changed
I have largeTitle on my navigation bar which shows correctly.
WHen I change my device orientation to landscape and back to portrait, it becomes regular instead of largeTitle.
This is a tab bar ...
1
vote
1
answer
578
views
Adjust position of custom Navigation Back Button
I am using a custom image as the back button of my Navigation Controller but the problem is that the image is not aligned correctly with the title and the right button item. I've been trying to move ...
2
votes
0
answers
865
views
navigationItem.searchController Behavior is different from ios12
In iOS12 the navigationItem.searchController should show when push down and hide on push up. bug in ios13, it can show, but never hide, unless your list is longer than the screen, below is my code, it ...