MRDropDown is a fully customizable UI component based on Google API autocomplete written in swift for IOS.
To run the example project, clone the repo, and run pod install
from the Example directory first.
IOS 9.0 or higher, IOS 10.0 for the Sample project
MRDropDown is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'MRDropDown'
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
)
While studing Swift I thought it may be nice to help or contribute others
Michael Rozenblat
MRDropDown is available under the MIT license. See the LICENSE file for more info.