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
How to Keep Uiswitch State When Changing Viewcontrollers
Searchdisplaycontroller Deprecated in iOS 8
How to Express Strings in Swift Using Unicode Hexadecimal Values (Utf-16)
How to Edit Uialertaction Text Font Size and Color
Swiftui - Animations Triggered Inside a View That's in a List Doesn't Animate the List as Well
How to Set Mime Type of Application/Vnd.Apple.Pkpass in Order to Share Pass by Link or Email
How to Copy SQLite Database When Application Is Launched in iOS
iOS Automatically Add Hyphen in Text Field
Find Attributes from Attributed String That User Typed
Confused About Orthographic Projection of Camera in Scenekit
Xcode 7 Supporting Watch Os1 and Os2
Uitableviewcell Imageview Changing on Select
Changed +Load Method Order in Xcode 7
Have a Variable with Multiple Types in Swift
Setting "Applelanguages" Doesn't Change App Language
How to Draw a Circle Path with Color Gradient Stroke