rnystrom / RNGridMenu

A grid menu with elastic layout, depth of field, and realistic animation.
MIT License
1.28k stars 192 forks source link

iOS 7 Animation #2

Open rnystrom opened 11 years ago

rnystrom commented 11 years ago

I'm not going to go into details because of the NDA (and if this breaks the NDA let me know immediately), but dismissing the view on iOS 7 does not invoke the scale animation. This might be a bug to report, or it might not.

If you find the solution please do not post the details here. I'd prefer either an email or a pull request so we can avoid any NDA issues.

so898 commented 10 years ago

Sometimes, when there are multiple threads running in background, all of the core animations will get 0fps when it playing. If someone tells you your project is showing no animation, just tell them go back to iOS6 or stop using multiple threads functions.

rnystrom commented 10 years ago

That is not very helpful. I discovered the issue back in beta 1. Might be an issue with release, might not. There aren't any background threads running during the animation (this issue occurs on the provided demo project).

myell0w commented 10 years ago

I can confirm that, the problem is still there on Beta 6.

myell0w commented 10 years ago

The bug is only slightly related to iOS7, so I think I can safely discuss it here. The problem arises in the viewWillLayoutSubviews method being called during the animation and re-setting the frame of the menuView. A simple fix is to guard the assignment of the menuView frame with an if (CGAffineTransformIsIdentity(self.menuView.transform)). Actually you might need to check for the layer transform, but I changed the Core Animation code to a simple UIView animation in my fork so I check for the views transform.