CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

PickerMenu 0.1.0

PickerMenu 0.1.0

Maintained by WeiRuJian.



  • By
  • WeiRuJian

PickerMenu

CI Status Version License Platform

Example

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

Requirements

iOS 8.0+

Installation

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

pod 'PickerMenu'

Usage

// create
lazy var pickerView: PickerMenu = {
     let picker = PickerMenu(frame: CGRect(x: 0, y: 600, width: self.view.bounds.width, height: 50))
     picker.delegate = self
     picker.dataSource = self
     picker.font = UIFont(name: "HelveticaNeue-Light", size: 20)!
     picker.highlightedFont = UIFont(name: "HelveticaNeue", size: 20)!
     picker.maskDisabled = false
     picker.pickerViewStyle = PickerMenuStyle.transform3D
     return picker
}()

// MARK: - PickerMenuDelegate&&PickerMenuDataSource

func numberOfInPicker(_ pickerView: PickerMenu) -> Int {
    return self.titles.count
}

func pickerView(_ pickerView: PickerMenu, titleForItem item: Int) -> String {
    return self.titles[item]
}

func pickerView(_ pickerView: PickerMenu, didSelected item: Int) {
    print(self.titles[item])
}

Author

WeiRuJian, [email protected]

License

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