Skip to content

Customizable UI dropdown for Google Api autocomplete places

License

Notifications You must be signed in to change notification settings

mikeRozen/MRDropDown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MRDropDown

Version License Platform

Getting Started

MRDropDown is a fully customizable UI component based on Google API autocomplete written in swift for IOS. screen shot 2018-09-19 at 19 43 57screen shot 2018-09-19 at 19 44 47

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

IOS 9.0 or higher, IOS 10.0 for the Sample project

Installation

MRDropDown is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MRDropDown'

Usage

You may use Interface Builder as well as write it in code. If you use Interface builder please subclass UITextfield with MRDropdown You will also need conform to MRTextFieldDelegate with the reqired method addressDictionary all the rest are optional You may specify your properties as Enum array of MRDropTextFieldOptions or set the properties later on.

let textFieldOtions = [MRDropTextFieldOptions.textColor(UIColor.black),
MRDropTextFieldOptions.nibName(nib:UINib.init(nibName: "TableViewCell", bundle: nil), reuseIdentifier: "cell"),
MRDropTextFieldOptions.leftViewImage(UIImage.init(named: "locationImage")),
MRDropTextFieldOptions.tintColor(UIColor.green),
MRDropTextFieldOptions.tableviewHight(250.0),
MRDropTextFieldOptions.paddingFromTextField(20.0),
MRDropTextFieldOptions.selectAllOnTouch(true),
MRDropTextFieldOptions.language("en"),
MRDropTextFieldOptions.apiKey("****")]

textField.setupOptions(textFieldOtions)
textField.mrDelegate = self

You can see the rest of additional properties under MRDropTextFieldOptions, just don't forget the google Api Key (apiKey)

Inspirations

While studing Swift I thought it may be nice to help or contribute others

Author

Michael Rozenblat

License

MRDropDown is available under the MIT license. See the LICENSE file for more info.

About

Customizable UI dropdown for Google Api autocomplete places

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published