Reputation: 623
How could i hide UIBarButtonItem
and space that it takes?
For hiding i use this code:
searchButton.isEnabled = false
searchButton.tintColor = UIColor.clear
But it still uses the space and if i have a third element it looks like a gap between them. Changing width does not solve my problem.
searchButton.width = 0.0
Upvotes: 1
Views: 106
Reputation: 623
The best solution that i found was searchButton.customView = UIView()
Upvotes: 0
Reputation: 2102
navigationItem.rightBarButtonItems Is an optional array of buttons on the right in the navigation bar. You go through it and remove a button from it.
Upvotes: 1