iDevelopper / PBRevealViewController

A UIViewController subclass for revealing a left and/or right view controller above or below a main view controller.
MIT License
80 stars 16 forks source link

Compatibility fixes for iOS <= 7.0 #5

Closed schmidt9 closed 8 years ago

schmidt9 commented 8 years ago

Some compatibility fixes for iOS <= 7.0 (tested with left view and leftPresentViewOnTop = NO)

schmidt9 commented 8 years ago

In my apps I target iOS 6.0, that's why these fixes for backward compatibility, they can be optional since using Categories

schmidt9 commented 8 years ago

well bugs found, should fix them :)

iDevelopper commented 8 years ago

What bugs did you find?

schmidt9 commented 8 years ago

In my pull request this override produces recursion + (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^ __nullable)(BOOL finished))completion { if ([UIView respondsToSelector:@selector(animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:)]) { [UIView animateWithDuration:duration delay:delay usingSpringWithDamping:dampingRatio initialSpringVelocity:velocity options:options animations:animations completion:completion]; } else { // since 4.0 [self animateWithDuration:duration delay:delay options:options animations:animations completion:completion]; } }

iDevelopper commented 8 years ago

Why did you close this pull request? I can't merge it. I am not a specialist of Github, can you tell me more? Ah this is because you found a bug in your pull request. I did not understand!

schmidt9 commented 8 years ago

Because I must elaborate aforementioned error with recursion in my code. Problem is how to call this method in UIView's Category, because if it responds to selector, we must call it itself, what leads to recursiin

schmidt9 commented 8 years ago

Full code you can see in tab "Files changed", formatting in ugly for ObjC code here

iDevelopper commented 8 years ago

I can do the class compatible with iOS 6 directly without category, it will are simple?

schmidt9 commented 8 years ago

Yes, it would be great

iDevelopper commented 8 years ago

1) UIVisualEffectView, UIBlurEffect, UIVibrancyEffect (since iOS 8): Do you need this? It is the more difficult to implement, I think!

2) UIViewControllerAnimatedTransitioning, UIViewControllerContextTransitioning (since iOS 7) ? I'm not going to implement this feature if iOS <= iOS7.

3) UIView: animationWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion: (since iOS 7): OK, it's easy to replace that with UIView animationWithDuration:delay:options:animations:completion: if iOS <= iOS 7.

4) UIViewController: willTransitionToSize:withTransitionCoordinator: (since iOS 8): I do not remember very well how the rotation was managed with iOS 6: (willAnimateRotationToInterfaceOrientation:duration: ???)

5) What do you think of this?

schmidt9 commented 8 years ago

I agree with your proposals. I personally don't need effects, only animation I use is animationWithDuration:delay:options:animations:completion, I even don't use rotation currently, so if you implement basic iOS 6 support (I mean at least that code not crashes because of unknown selectors) it will be great

schmidt9 commented 8 years ago

Also I have some troubles with vertical positioning of menu. But here I'm going to open a separate issue with screenshots

iDevelopper commented 8 years ago

I can't test on iOS 6, xCode 5 cannot be run on El Capitan. I have no device on iOS 6 ?? How do you do?

schmidt9 commented 8 years ago

I have iPhone 4 with iOS 6, so I can test

iDevelopper commented 8 years ago

Great! 👍