Closed vadimvitvickiy closed 7 years ago
Could you please specify your problem? Please show me the code which you wrote.
func pickDate() {
let dates = schedules.map {
GKActionSheetPickerItem(title: $0.start?.string(format: dateShowFormat), value: $0)!
}
let actionSheetPicker = GKActionSheetPicker.stringPicker(withItems: dates, selectCallback: { [unowned self] schedule in
self.selectedDate = (schedule as! Schedule).start
}, cancelCallback: nil)
actionSheetPicker?.dismissType = .cancel
actionSheetPicker?.present(on: mainVC?.view)
}
I don't know much about Swift (honestly: never tried the lib in Swift) but this should work. I'll take a look at it.
It's even not working in Objective-C either:
GKActionSheetPicker *picker = [GKActionSheetPicker stringPickerWithItems:self.words selectCallback:^(id selected) {
print(@"selected word: %@",selected);
} cancelCallback:^{
}];
Cannot cancel the sheet.
Please try use a strong reference to it, for example a @property
Yes, this was the reason. :)
After presenting picker cant dismiss it, and if scroll values they just disappear