From 8911a15fa218f4d13aad8d98c7a27690f46e52fb Mon Sep 17 00:00:00 2001 From: weak Date: Tue, 15 Oct 2019 13:31:49 +0200 Subject: [PATCH] add workaround for iOS 13 searchBar issue, fixes #60 --- .../Base.lproj/Main.storyboard | 30 +++++++++++-------- .../LocationPickerViewController.swift | 7 +++++ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Demo/LocationPickerDemo/Base.lproj/Main.storyboard b/Demo/LocationPickerDemo/Base.lproj/Main.storyboard index 0a40777..ba7871e 100644 --- a/Demo/LocationPickerDemo/Base.lproj/Main.storyboard +++ b/Demo/LocationPickerDemo/Base.lproj/Main.storyboard @@ -1,7 +1,10 @@ - - + + + - + + + @@ -13,33 +16,33 @@ - + - + @@ -66,9 +69,9 @@ - + - + @@ -81,8 +84,9 @@ - + + @@ -94,5 +98,5 @@ - + diff --git a/LocationPicker/LocationPickerViewController.swift b/LocationPicker/LocationPickerViewController.swift index 9b37c37..ac4cbdc 100644 --- a/LocationPicker/LocationPickerViewController.swift +++ b/LocationPicker/LocationPickerViewController.swift @@ -137,6 +137,13 @@ open class LocationPickerViewController: UIViewController { open override func viewDidLoad() { super.viewDidLoad() + + if #available(iOS 13.0, *), let navigationController = navigationController { + let appearance = navigationController.navigationBar.standardAppearance + appearance.backgroundColor = navigationController.navigationBar.barTintColor + navigationItem.standardAppearance = appearance + navigationItem.scrollEdgeAppearance = appearance + } locationManager.delegate = self mapView.delegate = self