Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

πŸ“ Map modal for searching and selecting a location

License

Notifications You must be signed in to change notification settings

hlfcoding/HLFMapViewController

Repository files navigation

HLFMapViewController

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. 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.

About

πŸ“ Map modal for searching and selecting a location

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /