Code Monkey home page Code Monkey logo

prglocationsearchbar's Introduction

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.

prglocationsearchbar's People

Contributors

ispiropoulos avatar jspiropoulosprogramize avatar

Stargazers

Mohammed Abunada avatar  avatar Omar avatar Ramzi BOUKERI avatar  avatar  avatar  avatar Victor avatar Roy avatar DiegoCaridei avatar Narcis avatar 김현준 avatar Weihan avatar  avatar Javier Manzo avatar Jonas Boserup avatar xlab avatar Mukesh Mandora avatar Ahmet Karalar avatar Ysee Monnier avatar Urtaq avatar Marcelo Sampaio avatar Fabiano Rosa avatar Tranld avatar Nigel Holmes avatar  avatar MohsinAli avatar

Watchers

James Cloos avatar MohsinAli avatar  avatar Dung NGUYEN VAN avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.