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

DatePicker inside scroll view #69

Open
Sorix opened this issue Jul 19, 2016 · 2 comments
Open

DatePicker inside scroll view #69

Sorix opened this issue Jul 19, 2016 · 2 comments

Comments

@Sorix
Copy link

Sorix commented Jul 19, 2016

If you have DatePicker inside Scroll View (Table View for example) you can’t scroll down datepicker (to select time/date), because instead of datepicker’s scrolling, view will be dragged down.

Temporary solution is only to set draggable = false.

@ahegazi18
Copy link

any solution for this one yet?

@ahegazi18
Copy link

I have been able to work around this, it is not the best solution but if it is a must that you have a draggable card with date picker you can use it.

  1. create extension for UIView and override touchesbegan with the following code.

override open func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { super.touchesBegan(touches, with: event) if let touch = touches.first { if touch.view != nil && String(describing: touch.view!.classForCoder) == "UIPickerTableViewWrapperCell" { NotificationCenter.default.post(name: NSNotification.Name(rawValue: ViewNotifcations.datePickerTouchesBegan.rawValue), object: nil) } else { NotificationCenter.default.post(name: NSNotification.Name(rawValue: ViewNotifcations.datePickerTouchesEnded.rawValue), object: nil) } } }

and add listen to those 2 notification and allow the draggable action when it is not "UIPickerTableViewWrapperCell" and disable it when user touch "UIPickerTableViewWrapperCell".
so far this works fine for me. again not the best solution.

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

2 participants