Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naxam/nativeplacepicker-ios-binding
iOS PlacePicker using entirely MapKit, CoreLocation
https://github.com/naxam/nativeplacepicker-ios-binding
corelocation mapkit placepicker xamarin xamarin-ios
Last synced: 5 days ago
JSON representation
iOS PlacePicker using entirely MapKit, CoreLocation
- Host: GitHub
- URL: https://github.com/naxam/nativeplacepicker-ios-binding
- Owner: NAXAM
- License: mit
- Created: 2017-03-26T15:24:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T16:14:55.000Z (over 7 years ago)
- Last Synced: 2024-11-21T14:39:42.310Z (about 1 month ago)
- Topics: corelocation, mapkit, placepicker, xamarin, xamarin-ios
- Language: Objective-C
- Size: 1.59 MB
- Stars: 2
- Watchers: 8
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iOS - MapKit PlacePicker
iOS PlacePicker using entirely MapKit, CoreLocation| | | |
| ------------- |:-------------:| -----:|
| ![Picker](./screenshots/picker.png) | ![Search](./screenshots/search.png)| ![Confirm](./screenshots/confirm.png) |
# Installation
CocoaPods
```
target 'MyApp' do
pod "NXPlacePicker"
end
```Nuget
```
Install-Package Naxam.iOS.PlacePicker
```# How to use
```Swift
import UIKit
import AddressBookUIclass ViewController: UIViewController , NXPlacePickerDelegate{
@IBOutlet weak var btnPickPlace: UIButton!
@IBOutlet weak var lblSelectedPlace: UILabel!
@IBAction func doPickPlace(_ sender: UIButton) {
let vc = NXPlacePickerViewController.initWith(self)
self.present(vc, animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
}
// NXPlacePickerDelegate
func placePicker(_ viewController: NXPlacePickerViewController, didSelectPlace place: MKPlacemark) {
viewController.dismiss(animated: true, completion: nil)
lblSelectedPlace.text = ABCreateStringWithAddressDictionary(place.addressDictionary!, false)
print(place)
}
}
``````C#
using System;
using System.Collections.Generic;
using Foundation;
using MapKit;
using Naxam.iOS.PlacePicker;
using UIKit;namespace DemoBindingNXPlacePicker
{
public partial class ViewController : UIViewController, INXPlacePickerDelegate
{
protected ViewController(IntPtr handle) : base(handle)
{
// Note: this .ctor should not contain any initialization logic.
}public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.btnSelectPlace.TouchUpInside += delegate {
NXPlacePickerViewController vc = NXPlacePickerViewController.InitWithDelegate(this);
this.PresentViewController(vc, true, null);
};
}public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
}public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}// INXPlacePickerDelegate
public void DidSelectPlace(NXPlacePickerViewController viewController, MKPlacemark place)
{
viewController.DismissViewController(true, null);
var addressLines = place.AddressDictionary["FormattedAddressLines"] as NSArray;
lblSelectedPlace.Text = string.Join(", ", (IEnumerable)NSArray.FromArray(addressLines));
//throw new NotImplementedException();
}
}
}
```