Closed benjohnde closed 7 years ago
Check, that's in your demo project as the syntax has changed. I am working on it. You will receive another PR today. The actual library is working as intended.
As of now, the func datePickerTapped
should be like the following:
/* IBActions */
@IBAction func datePickerTapped(sender: AnyObject) {
let currentDate = Date()
var dateComponents = DateComponents()
dateComponents.month = -3
let threeMonthAgo = Calendar.current.date(byAdding: dateComponents, to: currentDate)
DatePickerDialog().show(title: "DatePickerDialog", doneButtonTitle: "Done", cancelButtonTitle: "Cancel", minimumDate: threeMonthAgo, maximumDate: currentDate, datePickerMode: .date) {
(date) -> Void in
if let dt = date {
self.textField.text = "\(dt)"
} else {
print("")
}
}
}
Cheers, Ben!
You may also need to set the project you are using to the latest Swift syntax.
You can achieve that by explicitly setting "Use Legacy Swift Language Version" to "No" under "Build Settings". Saying that, I assume you are using the latest Xcode 8 😃
@benjohnde Still getting this error