John-Lluch / SWRevealViewController

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !
Other
4.52k stars 989 forks source link

UIViewAnimationOptions #124

Closed didzis closed 10 years ago

didzis commented 10 years ago

Hello, in some situations it would be good to have the ability to temporarily specify animation options, for example, instead of just UIViewAnimationOptionCurveEaseOut to be able to set UIViewAnimationOptionCurveEaseOut | UIViewAnimationOptionLayoutSubviews | UIViewAnimationOptionBeginFromCurrentState just for some animations (calls to setFrontViewPosition:animated:). This is useful, for example, when animating together with UISearchBar (with UISearchDisplayController's animations). Thanks.

John-Lluch commented 10 years ago

Hi, I understand your request. This is possibly just a matter of adding a property to set the desired animations, or to provide methods taking the actual animation options instead of a BOOL.

However, please could you elaborate on how do you use this, and why this would be useful?

Thanks !

didzis commented 10 years ago

I have rearView or rightView with UITableView (inside UINavigationController with navigation bar visible) with UISearchDisplayController's UISearchBar as the header view of UITableView. The default behaviour of UISearchDisplayController, when touching that search bar, is to hide navigation bar with animation, and I want to hide frontView completely with animation in paar with the UISearchDisplayController's animation. Actually, it's the same as here: https://github.com/John-Lluch/SWRevealViewController/issues/8 Both animations don't play nice together. You wrote that UISearchBar does not animate along with the UITableView size change animation. The solution is to add UIViewAnimationOptionLayoutSubviews. To play on paar with other animations, UIViewAnimationOptionBeginFromCurrentState can be used. But this applies only to specific cases like this, so it would be good to be able to choose animation options.