Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albertmontserrat/uiplacepicker
Simple UIPlacePicker
https://github.com/albertmontserrat/uiplacepicker
Last synced: 2 months ago
JSON representation
Simple UIPlacePicker
- Host: GitHub
- URL: https://github.com/albertmontserrat/uiplacepicker
- Owner: AlbertMontserrat
- Created: 2015-05-05T13:07:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-19T12:12:45.000Z (over 9 years ago)
- Last Synced: 2023-03-01T17:40:42.344Z (almost 2 years ago)
- Language: Objective-C
- Size: 1.59 MB
- Stars: 58
- Watchers: 8
- 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
![](https://github.com/AlbertMontserratGambus/UIPlacePicker/blob/master/Screenshot1.png)
![](https://github.com/AlbertMontserratGambus/UIPlacePicker/blob/master/Screenshot2.png)
## 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.