iOS 13 Uibarbuttonitem Not Clickable and Overlapping Uinavigationbars When Using Uisearchcontroller

Navigation bar gets blocked after pressing Cancel in UISearchController

I encountered the same problem, if I cancel the searchBar and change the navigationItem.title then I have a double title . It's like a ghost layer of the navigation bar stays here in the navigation controller.

This is how I fixed it:

searchController.hidesNavigationBarDuringPresentation = true

Probably best to use it until Apple fix this issue.

I also noticed that the back button switch to default color (blue), as if the navigationBar TintColor was reset.

Config:
- Xcode 11.0 (11A420a)
- iOS 13.1 (17A5844a)

NavigationBar Buttons Click Area not working properly (Image is not clickable)

There are possible 2 solutions that I found so far

1) Downgrade Xcode to 11.3.1 from
https://developer.apple.com/download/more/?q=xcode

2) This UIButton extension breaks all the UIBarButtons in Navigation Bar and also in Tool Bar. This is just for my case. You may have same override func that may break.

extension UIButton{
open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
return self.bounds.contains(point) ? self : nil
}
}

iOS 13 navigation bar issue - part of navigation bar becomes transparent

The workaround is to add the following code to the viewDidLoad method:

if #available(iOS 13, *) {
let appearance = navigationController?.navigationBar.standardAppearance.copy()
navigationItem.standardAppearance = appearance
}

Duplicate Title Text when placing GooglePlaces SearchController into NavigationItem in iOS 13

This has been fixed with iOS 13.2

Navigation Bar's content partially not visible in modal on iOS 13

Based on the answer at How to prevent gap between uinavigationbar and view in iOS 13?, which wasn't working for me, I solved my issue using the following code:

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if #available(iOS 13.0, *) {
self.navigationController?.setNavigationBarHidden(true, animated: false)
self.navigationController?.setNavigationBarHidden(false, animated: false)
}
}

Or in Objective-C:

-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if(@available(iOS 13, *)) {
[self.navigationController setNavigationBarHidden:true animated:false];
[self.navigationController setNavigationBarHidden:false animated:false];
}
}


Related Topics



Leave a reply



Submit