To run the example project, clone the repo, and run pod install
from the Example directory first.
s.swift_version = '5.0'
s.ios.deployment_target = '9.0'
LocationPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'LocationPicker', :git => 'https://github.com/0x30/LocationPicker'
import CoreLocation
import LocationPicker
class ViewController: UIViewController {
@IBOutlet weak var descLabel: UILabel!
@IBAction func selectLocation(){
let viewController = LocationPickerViewController()
viewController.pickerDelegate = self
self.present(viewController, animated: true, completion: nil)
}
}
extension ViewController: LocationPickerViewControllerDelegate{
func userDidCancel() {
self.dismiss(animated: true, completion: nil)
}
func userSelectLocation(placemark: CLPlacemark) {
self.dismiss(animated: true, completion: nil)
descLabel.text = placemark.formatString
}
}
200739491@qq.com, 200739491@qq.com
LocationPicker is available under the MIT license. See the LICENSE file for more info.