Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid frame position when using demo view controller #1063

Closed
dvkch opened this issue Nov 24, 2014 · 4 comments
Closed

Invalid frame position when using demo view controller #1063

dvkch opened this issue Nov 24, 2014 · 4 comments

Comments

@dvkch
Copy link

dvkch commented Nov 24, 2014

Hi,

I am trying out your library and I am quickly facing a strange issue. The demo project runs fine on iOS6-7-8 and iPhone 4-5-6 (even after enabling iPhone 6 screen support), though if I use the exact same code in my own app it fails. Literally the same code, except for the added #import <UIKit/UIKit.h> in the view controller header.

The exception is thrown at line 24 of the view controller class: self.view.frame = animationFrame.frame; with exception CALayer position contains NaN: [nan nan].

Here is a link to the sample project: https://github.com/dvkch/JazzHandsBug1063 .

Thanks for taking time to look into this, Stan

@jhersh
Copy link
Contributor

jhersh commented Dec 5, 2014

Ahoy @dvkch! Sorry I missed this until now.

I can't find that code you mention at line 24 in any file of your sample project. Do you have a direct link?

That said, I don't think you want to set a view controller's view frame to be equal to a keyframe animation object's frame, as the keyframe can and will change as the animation is played. Plus, the frame may not be set until the animation begins, which might explain this error you're seeing. Perhaps you meant to add the animation to a subview instead?

@dvkch
Copy link
Author

dvkch commented Dec 10, 2014

No problem. The view controller is IFTTTJazzHandsViewController, a direct copy from the example project in this library. The trace is:
-[IFTTTAnimatedScrollViewController scrollViewDidScroll:] line 45
-[IFTTTAnimator animate:] line 34
-[IFTTTFrameAnimation animate:] line 24

Here is a screenshot of the debug session in XCode:
screen shot 2014-12-10 at 18 58 26

The issue is: the same exact code works perfectly in your demo project, but it doesn't in a new project.
I wanted to know why that is because i want to start using your app by playing with this demo tutorial and integrate it in my own project.

@jhersh
Copy link
Contributor

jhersh commented Dec 10, 2014

@dvkch You are creating animations and references for two images (Unicorn and IFTTT) that are not included in your sample app.

@dvkch
Copy link
Author

dvkch commented Dec 10, 2014

Hehe indeed. Sorry for the trouble!

@dvkch dvkch closed this as completed Dec 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants