Usage improvements#198
Conversation
evnaz
left a comment
There was a problem hiding this comment.
@igorkulman Thanks for the contribution. I find these changes useful. Though I have concerns regarding calling a delegate method inside an animation block. Please see my comment for a possible solution.
| withDuration: animationDuration, | ||
| animations: { [weak self] () -> Void in | ||
| self?.sideMenuContainerView.frame = destFrame | ||
| self?.delegate?.sideMenuIsAnimating() |
There was a problem hiding this comment.
I anticipate some unexpected side effects on the use site if the delegate method would be called inside an animation block. Instead I would suggest introducing another two delegate callbacks with an isAnimated argument and call them before scheduling the animation:
sideMenuWillOpen:isAnimated
sideMenuWillClose:isAnimated
I see this as a more universal approach.
There was a problem hiding this comment.
This is a good point, but my specific case requries the delegate call inside the animate method so the statubar changes gradually not at once wzen animation startes or finishes.
This PR adds a few improvements I came up using the side menu in my project