ios - Day of the week multi-select UI -
i creating events app , need allow user select day of week, ie. mon, tues, weds,..etc if want create repeating event.
is there library/enums or functionality allows selection pre-built? ( in same way datepicker ui built?)
add in interface builder, connect delegate
, data source
, , add following code uiviewcontroller
.
let pickerdata = nscalendar.currentcalendar().shortweekdaysymbols func numberofcomponentsinpickerview(pickerview: uipickerview) -> int { return 1 } func pickerview(pickerview: uipickerview, numberofrowsincomponent component: int) -> int { return pickerdata.count } func pickerview(pickerview: uipickerview, titleforrow row: int, forcomponent component: int) -> string? { return pickerdata[row] } func pickerview(pickerview: uipickerview, didselectrow row: int, incomponent component: int) { // code here. }
Comments
Post a Comment