ARPicker
Requirements
- iOS 9.0
- Xcode 11.2
- Swift 5
Installation
ARPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ARPicker'Then, run the following command:
pod installUsage
Import
import ARPickerInitialization
Then Go to your viewController and to show picker as following:
let countryList :[String] = ["Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba"]
self.showPickerView(options: countryList, selectedOption: "Andorra", doneTitleText: "Done",cancelTitleText: "Cancel",didSelectDate: { (selectedValue, selectedIndex) in
print("Selected value: \(selectedValue)")
print("Selected Index: \(selectedIndex)")
self.selectedValueLabel.text = selectedValue
self.selectedIndexLabel.text = "\(selectedIndex + 1)"
})Explanation of different parameters
- set value of
selectedOptionto highlight the option at start. - set value of
doneTitleTextto change done button title. - set value of
cancelTitleTextto change cancel button title. - set completion block
didSelectDate, called whenDonebutton is touched.
Author
AbdulRehman Warraich, [email protected]
License
ARPicker is released under the MIT license. See LICENSE for details.
