Skip to content

Easy way to display and search a location (with offline DB) in a simple UITableViewController

License

Notifications You must be signed in to change notification settings

furiosFast/MRFilteredLocations

Repository files navigation

MRFilteredLocations

SPM ready Platform Swift Xcode License Twitter

Easy way to search a location (offline DB) in a simple UITableViewController

Requirements

  • iOS 13.0+
  • Xcode 12.5+
  • Swift 5+

Installation

Swift Package Manager

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")
]

Manually

If you prefer not to use any of the aforementioned dependency managers, you can integrate MRFilteredLocations into your project manually.

Usage

Example

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)
    }

}

Requirements

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!

License

MRFilteredLocations is released under the MIT license. See LICENSE for more information.

About

Easy way to display and search a location (with offline DB) in a simple UITableViewController

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages