Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <<< PickerInlineRow<NSDate>("PickerInlineRow") { (row : PickerInlineRow<NSDate>) -> Void in
- row.title = row.tag
- row.displayValueFor = {
- guard let date = $0 else{
- return nil
- }
- let year = NSCalendar.currentCalendar().component(.Year, fromDate: date)
- return "Year (year)"
- }
- row.options = []
- var date = NSDate()
- for _ in 1...10 {
- row.options.append(date)
- date = date.dateByAddingTimeInterval(60*60*24*365)
- }
- row.value = row.options[0]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement