Skip to content

Instantly share code, notes, and snippets.

@ykws
Last active August 23, 2017 18:32
Show Gist options
  • Save ykws/ff74c7b3e08916d9abf0727c78bbfd9d to your computer and use it in GitHub Desktop.
Save ykws/ff74c7b3e08916d9abf0727c78bbfd9d to your computer and use it in GitHub Desktop.
For ActionSheetDatePicker, set disable before today.
import UIKit
class ActionSheetDemoViewController: UIViewController {
@IBAction func showDatePicker(_ sender: UIButton) {
guard let actionSheetDatePicker = ActionSheetDatePicker.init(title: "Set date", datePickerMode: .date, selectedDate: Date(), doneBlock: {
picker, value, index in
/* doneBlock */
}, cancel: { ActionDateCancelBlock in return }, origin: sender.superview!.superview) else {
return
}
actionSheetDatePicker.minimumDate = Date()
actionSheetDatePicker.show()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment