JASidePanels
JASidePanels copied to clipboard
Fix unintentional wait if bounce is disabled
-
Summary: If
bounceOnCenterPanelChange
is disabled and the center panel is still performing animations, the change of the center panel is not immediate, but waits until animations are completed. -
Steps to Reproduce:
- Create center panel with scroll view
- Run application and flick scroll view in center panel
- Call
setCenterPanel
while scroll view is still scrolling
- Actual Results: Center panel is changed after (unrelated) animations are finished, e.g., scroll view is still animating the scroll
- Expected Results: Center panel should be changed immediately
-
Cause:
setCenterPanel
is usingUIView.animateWithDuration
, but theanimations
block performs no changes ifbounceOnCenterPanelChange
is false. Theanimations
block is thus empty and thecompletion
block fires after unrelated animations are comleted. -
Fix: Don't use
UIView.animateWithDuration
ifbounceOnCenterPanelChange
is false, perform actions of completion block immediately.