Easy way to search a location (offline DB) in a simple UITableViewController
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):
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.
link |
Stars: 0 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics