We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is the code executed on UIBarbuttonItem but gives error on bar button click.
@IBAction func calender_date(_ sender: UIBarButtonItem) { let datePicker = ActionSheetDatePicker(title: "Date:", datePickerMode: UIDatePickerMode.date, selectedDate: NSDate() as Date!, doneBlock: { picker, value, index in print("value = \(value)") print("index = \(index)") print("picker = \(picker)") return }, cancel: { ActionStringCancelBlock in return }, origin: (sender as AnyObject).superview!?.superview) let secondsInWeek: TimeInterval = 7 * 24 * 60 * 60; datePicker?.minimumDate = NSDate(timeInterval: -secondsInWeek, since: NSDate() as Date) as Date! datePicker?.maximumDate = NSDate(timeInterval: secondsInWeek, since: NSDate() as Date) as Date! datePicker?.show() }
The Error is this
fatal error: unexpectedly found nil while unwrapping an Optional value
This line is highlitted in red
}, cancel: { ActionStringCancelBlock in return }, origin: (sender as AnyObject).superview!?.superview)
The text was updated successfully, but these errors were encountered:
What's going on with the !? here (sender as AnyObject).superview!?.superview Did you check if this isn't causing the issue?
!?
(sender as AnyObject).superview!?.superview
Sorry, something went wrong.
There is no recent activity for this issue. Seems this issue is not valid anymore. Feel free to reopen it, if I'm wrong.
No branches or pull requests
Here is the code executed on UIBarbuttonItem but gives error on bar button click.
The Error is this
This line is highlitted in red
The text was updated successfully, but these errors were encountered: