rnystrom / RNSwipeViewController

Swipe in view controllers from off-screen similar to Check the Weather.
MIT License
293 stars 50 forks source link

enable pan back animation for 1side+center setup #2

Closed linkov closed 11 years ago

linkov commented 11 years ago

I use RNSwipeViewController in an app where I only need center and left controllers. If I don't setup right controller I don't get animation when I want to pan back from left to center controller. I added condition that animation should be skipped only if opposite side controller is not set and also center controller is centered in view. I also made canShowLeft / canShowRight checks more explicit because this way it's easier to understand the condition.

moleksyuk commented 11 years ago

@linkov thanks for your fix. It works for me as well where I have only central view and right one.

I also made canShowLeft / canShowRight checks more explicit because this way it's easier to understand the condition.

According to Google Objective-C Style Guide it's not recommended to compare directly to BOOL.

emichaud commented 11 years ago

@linkov - thank you, nice job. Your update is working well for me also!

emichaud commented 11 years ago

thank you Ryan!