I am currently trying to use Eureka, a easy to use form generator for iOS in Swift.
Everything is going smooth, except one thing:
How to design a custom PickerinlineRow like in the example app at example/InlineRows/PickerInlineRow
The code used there is the following:
<<< 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]
}
What I want to do is a same kind of InlinePicker but allowing the user to select 2 things: Month and Year. Problem is that I don't grasp the logic of the above piece of code, which var serve for what.
My current try are all totally not working.. If you have any idea.