Skip to content
New issue

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

Adding actionsheet date picker on uitableview cell class doesn't dismiss it when pressing done #419

Closed
zoufishanmehdi opened this issue Jun 27, 2019 · 0 comments

Comments

@zoufishanmehdi
Copy link

Hi, I added the follow code in a UITableViewCell class to show date picker upon pressing a button in the cell. However, the date picker doesn't get dismissed when I press done. Instead, it executes the code below cancel and then return in the done block and keeps showing the date picker. Appreciate your help. Thank you!

        let datePicker = ActionSheetDatePicker(title: "Date", datePickerMode: UIDatePickerMode.date, selectedDate: Date(), doneBlock: {
            picker, value, index in
            picker?.toolbarButtonsColor = UIColor.blue
            if let dateSelected = value as? Date {
                self.dateButton.setTitle(DateFormat.dateToMonthLettersDayYearString(date: dateSelected), for:.normal)
                self.dateButtonTapped(dateSelected)
            }
            return
            //self.superview?.superview
        }, cancel: { ActionStringCancelBlock in return }, origin: self.superview?.superview)
        datePicker?.toolbarButtonsColor = UIColor.white
        datePicker?.toolbarBackgroundColor = UIColor.lightGray
        datePicker?.show()
    }```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant