Easy way to search a location (offline DB) in a simple UITableViewController
- iOS 13.0+
- Xcode 12.5+
- Swift 5+
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler. It is in early development, but MRFilteredLocations does support its use on supported platforms.
Once you have your Swift package set up, adding MRFilteredLocations as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/furiosFast/MRFilteredLocations.git", from: "1.0.0")
]
If you prefer not to use any of the aforementioned dependency managers, you can integrate MRFilteredLocations into your project manually.
import CoreLocation
import MRFilteredLocations
class ViewController: UIViewController, MRFilteredLocationsDelegate {
//MARK: - Delegates
func didSelect(filteredLocation: Location) {
let sl = CLLocation(latitude: filteredLocation.latitude, longitude: filteredLocation.longitude)
...
}
func swipeDownDismiss(controller: MRFilteredLocations) {
controller.navigationController?.popViewController()
}
//MARK: - IBActions
@IBAction func searchLocationForecast(_ sender: Any) {
let searchVC = MRFilteredLocations()
searchVC.delegate = self
self.navigationController?.pushViewController(searchVC, animated: true)
}
}
MRFilteredLocations has different dependencies and therefore needs the following libraries (also available via SPM):
- SQLite.swift 0.13.0+
It isn't necessary to add the dependencies of MRFilteredLocations, becose with SPM all is do automatically!
MRFilteredLocations is released under the MIT license. See LICENSE for more information.