Skip to content

Commit

Permalink
fix over-release of UISearchController view, closes #61
Browse files Browse the repository at this point in the history
  • Loading branch information
weakfl committed Nov 4, 2019
1 parent d450aad commit 8c8d5e4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Demo/LocationPickerDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.1</string>
<string>1.4.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion LocationPicker.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'LocationPicker'
s.version = '1.4.1'
s.version = '1.4.2'
s.author = { 'Almas Sapargali' => 'almassapargali@gmail.com' }
s.homepage = 'https://github.com/almassapargali/LocationPicker'
s.description = "LocationPickerViewController is a UIViewController subclass to let users choose locations by searching or selecting on map. It's designed to work as UIImagePickerController."
Expand Down
2 changes: 1 addition & 1 deletion LocationPicker/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.4.1</string>
<string>1.4.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
6 changes: 3 additions & 3 deletions LocationPicker/LocationPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ open class LocationPickerViewController: UIViewController {
results.searchHistoryLabel = self.searchHistoryLabel
return results
}()

lazy var searchController: UISearchController = {
let search = UISearchController(searchResultsController: self.results)
search.searchResultsUpdater = self
Expand All @@ -118,8 +118,6 @@ open class LocationPickerViewController: UIViewController {
searchTimer?.invalidate()
localSearch?.cancel()
geocoder.cancelGeocode()
// http://stackoverflow.com/questions/32675001/uisearchcontroller-warning-attempting-to-load-the-view-of-a-view-controller/
let _ = searchController.view
}

open override func loadView() {
Expand Down Expand Up @@ -166,6 +164,8 @@ open class LocationPickerViewController: UIViewController {
navigationItem.searchController = searchController
} else {
navigationItem.titleView = searchBar
// http://stackoverflow.com/questions/32675001/uisearchcontroller-warning-attempting-to-load-the-view-of-a-view-controller/
_ = searchController.view
}
definesPresentationContext = true

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ locationPicker.location = initialLocation
// button placed on right bottom corner
locationPicker.showCurrentLocationButton = true // default: true

// default: navigation bar's `barTintColor` or `.whiteColor()`
locationPicker.currentLocationButtonBackground = .blueColor()
// default: navigation bar's `barTintColor` or `UIColor.white`
locationPicker.currentLocationButtonBackground = .blue

// ignored if initial location is given, shows that location instead
locationPicker.showCurrentLocationInitially = true // default: true
Expand Down

0 comments on commit 8c8d5e4

Please sign in to comment.