weilsonwonder / WWCalendarTimeSelector

A android inspired iOS date/time picker
MIT License
317 stars 126 forks source link

Crash upon scrolling year #43

Open happiehappie opened 7 years ago

happiehappie commented 7 years ago

Steps to reproduce (even in demo project, no modification needed) Not sure if this is for every mode but I encountered this in DateMonth + Year. Steps to reproduce:

It then crashes at scrollView.contentOffset = CGPoint(x: 0, y: offsetY + triggerPoint * 2)

DmitryMoroz commented 7 years ago

Change "contentOffset" property to "bounds.origin": scrollView.bounds.origin = CGPoint(x: 0, y: offsetY + triggerPoint * 2) Setting content offset manually triggers func scrollViewDidScroll(_ scrollView: UIScrollView) where you setting offset again etc. Recursive calls lead to crash.