diff --git a/LocationPicker/LocationPickerViewController.swift b/LocationPicker/LocationPickerViewController.swift index ef1e466..66e5838 100644 --- a/LocationPicker/LocationPickerViewController.swift +++ b/LocationPicker/LocationPickerViewController.swift @@ -27,7 +27,7 @@ public class LocationPickerViewController: UIViewController { /// default: true public var showCurrentLocationInitially = true - /// see region property of MKLocalSearchRequest + /// see `region` property of `MKLocalSearchRequest` /// default: false public var useCurrentLocationAsHint = false diff --git a/README.md b/README.md index 3a7ced9..abf9bd9 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,9 @@ pod 'LocationPicker' ![](https://raw.githubusercontent.com/almassapargali/LocationPicker/master/Screenshots/screen1.jpg) -![](https://raw.githubusercontent.com/almassapargali/LocationPicker/master/Screenshots/screen2.jpg) +![](https://raw.githubusercontent.com/almassapargali/LocationPicker/master/Screenshots/screen2.png) + +Clicking back button cancelling picking, clicking `Select` selects that locations, calls callback, and pops or dismisses view controller. ![](https://raw.githubusercontent.com/almassapargali/LocationPicker/master/Screenshots/screen3.jpg) @@ -37,11 +39,29 @@ let locationPicker = LocationPickerViewController() // you can optionally set initial location let location = CLLocation(latitude: 35, longitude: 35) -let initialLocation = Location(name: nil, location: location) +let initialLocation = Location(name: "My home", location: location) locationPicker.location = initialLocation -// optional region distance to be used for creation region when user selects place from search results (defaults to 600) -locationPicker.resultRegionDistance = 500 +// button placed on right bottom corner +locationPicker.showCurrentLocationButton = true // default: true + +// default: navigation bar's `barTintColor` or `.whiteColor()` +locationPicker.currentLocationButtonBackground = .blueColor() + +// ignored if initial location is given, shows that location instead +locationPicker.showCurrentLocationInitially = true // default: true + +locationPicker.mapType = .Standard // default: .Hybrid + +// for searching, see `MKLocalSearchRequest`'s `region` property +locationPicker.useCurrentLocationAsHint = true // default: false + +locationPicker.searchBarPlaceholder = "Search places" // default: "Search or enter an address" + +locationPicker.searchHistoryLabel = "Previously searched" // default: "Search History" + +// optional region distance to be used for creation region when user selects place from search results +locationPicker.resultRegionDistance = 500 // default: 600 locationPicker.completion = { location in // do some awesome stuff with location @@ -50,8 +70,6 @@ locationPicker.completion = { location in navigationController?.pushViewController(locationPicker, animated: true) ``` -*Note: `LocationPickerViewController` is expected to be pushed to `UINavigationController`. Pull requests for supporting other presentation styles are welcome* - ## License -LocationPicker is available under the MIT license. See the LICENSE file for more info. \ No newline at end of file +LocationPicker is available under the MIT license. See the LICENSE file for more info. diff --git a/Screenshots/screen2.jpg b/Screenshots/screen2.jpg deleted file mode 100644 index c41b9fe..0000000 Binary files a/Screenshots/screen2.jpg and /dev/null differ diff --git a/Screenshots/screen2.png b/Screenshots/screen2.png new file mode 100644 index 0000000..d6a97f6 Binary files /dev/null and b/Screenshots/screen2.png differ