Latest 0.4.0
Homepage https://github.com/hlfcoding/HLFMapViewController
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit, CoreLocation, MapKit
Authors

Version
License
Platform
Code Climate

A generic implementation of a common feature: searching and selecting a nearby location from an MKMapView.

screenshot-1   screenshot-2

Usage

This version uses Swift 3 and Cocoapods 0.1.0+. The final Swift 2 version is 0.2.5.

To run the example project, clone the repo, and run pod install from the Example directory first.

In addition to turning on the ‘Maps’ capability, you’ll need to add location-services to UIRequiredDeviceCapabilitiesand fill in NSLocationAlwaysUsageDescription in your Info.plist.

Other than that just set up the view controller and implement the delegate method:

// ...
let mapViewController = MapViewController(nibName: "MapViewController", bundle: MapViewController.bundle)
mapViewController.delegate = self
mapViewController.selectedMapItem = self.selectedMapItem // Optional.
// ...

func mapViewController(_ mapViewController: MapViewController, didSelectMapItem mapItem: MKMapItem) {
    self.selectedMapItem = mapItem // Save, submit, etc.
    mapViewController.dismissViewController(animated: true, completion: nil)
}

See example app for more details.

Installation

HLFMapViewController is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "HLFMapViewController"

License

HLFMapViewController is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "HLFMapViewController",
    "version": "0.4.0",
    "summary": "Map modal for searching and selecting a location.",
    "description": "A generic implementation of a common feature: searchingnand selecting a nearby location from an MKMapView.",
    "screenshots": [
        "https://dl.dropboxusercontent.com/u/305699/hlf-map-view-controller-1-2.png",
        "https://dl.dropboxusercontent.com/u/305699/hlf-map-view-controller-2-2.png"
    ],
    "homepage": "https://github.com/hlfcoding/HLFMapViewController",
    "license": "MIT",
    "authors": {
        "Peng Wang": "[email protected]"
    },
    "source": {
        "git": "https://github.com/hlfcoding/HLFMapViewController.git",
        "tag": "0.4.0"
    },
    "social_media_url": "https://twitter.com/hlfcoding",
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resources": "Pod/Assets/**/*",
    "frameworks": [
        "UIKit",
        "CoreLocation",
        "MapKit"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This