Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ispiropoulos/PRGLocationSearchBar

Open more actions menu

Repository files navigation

PRGLocationSearchBar

Control used to show a search bar which can fetch your location as well as geocode a search string

Demo

PRGLocationSearchBar

Requirements

iOS >= 9.x Swift 3.0

Installation

Just copy the PRGLocationSearchBar folder into your project

Usage

  • Drag a UIView using interface builder and set it’s class to PRGLocationSearchBar
  • You can programmatically add the search bar by using init(frame:) method.

PRGLocationSearchBarDelegate (all methods are optional)

func locationSearchBar(searchBar: PRGLocationSearchBar, didTapLocationButton: UIButton) {
	print("Location Button Tapped")
}
func locationSearchBar(searchBar: PRGLocationSearchBar, didTapSearchButton: UIButton, withSearchString searchString: String) {
   print("Search Button Tapped")
}
func locationSearchBar(searchBar: PRGLocationSearchBar, didFindLocationWith lat: Double, lon: Double, address: Dictionary<AnyHashable, Any>?) {
   print(“COORDINATE\nLat: \(lat)\nLon:\(lon))
   for key in address!.keys where address != nil {
       print(\(key): \(address![key]!)\n")
   }
}
func locationSearchBar(searchBar: PRGLocationSearchBar, didEditSearchTextWith text: String) {
    print(text)
}
func locationSearchBar(searchBar: PRGLocationSearchBar, didStartEditingTextField textField: UITextField) {
    print("Started editing search field")
}
func locationSearchBar(searchBar: PRGLocationSearchBar, didFailToFindLocationWith error: Error) {
    print(error.localizedDescription)
}

License

PRGLocationSearchBar is available under the MIT license.

About

Control used to show a search bar which can fetch your location as well as geocode a search string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.