https://github.com/albertmontserrat/uiplacepicker
Simple UIPlacePicker
https://github.com/albertmontserrat/uiplacepicker
Last synced: 3 months ago
JSON representation
Simple UIPlacePicker
- Host: GitHub
- URL: https://github.com/albertmontserrat/uiplacepicker
- Owner: AlbertMontserrat
- Created: 2015-05-05T13:07:54.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-19T12:12:45.000Z (about 10 years ago)
- Last Synced: 2025-03-28T19:44:51.709Z (3 months ago)
- Language: Objective-C
- Size: 1.59 MB
- Stars: 58
- Watchers: 7
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UIPlacePicker
UIPlacePicker is a UIViewController where the user can pick a location from a map or entering the complete address.
## Features
* Support iOS 6.0 and above.
* Use iOS 4 MapKit built-in draggable support
* Use Google services to determinate a location from an address and to determinate the address from one location
* It works like UIImagePickerViewController, with delegates.## Screenshot


## How it works
To open a new UIPlacePicker just do:
```
picker = [[UIPlacePicker alloc] initWithUIPlace:nil];
picker.delegate = self;
[self presentViewController:picker animated:YES completion:^{
}];
```You must implement the delegates functions:
```
-(void)placePickerDidSelectPlace:(UIPlace *)__place{
UIPlace *place = __place;
[self hidePlacePicker];
}-(void)placePickerDidCancel{
[self hidePlacePicker];
}-(void)hidePlacePicker{
[picker dismissViewControllerAnimated:YES completion:^{
}];
}
```When you hace already a UIPlace, you can also call the UIPlacePicker with this place pre-loaded:
```
picker = [[UIPlacePicker alloc] initWithUIPlace:place];
picker.delegate = self;
[self presentViewController:picker animated:YES completion:^{
}];
```And if you want only to show the place and disable the edit functionalities, just do:
```
picker = [[UIPlacePicker alloc] initWithUIPlaceOnlyVisitor:place];
picker.delegate = self;
[self presentViewController:picker animated:YES completion:^{
}];
```## License
This project is released under MIT License.