Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
almassapargali committed Feb 11, 2016
1 parent b50f506 commit aba5752
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion LocationPicker/LocationPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand All @@ -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.
LocationPicker is available under the MIT license. See the LICENSE file for more info.
Binary file removed Screenshots/screen2.jpg
Binary file not shown.
Binary file added Screenshots/screen2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aba5752

Please sign in to comment.