-
-
Save Shereef/78411dbeee908ac509ba to your computer and use it in GitHub Desktop.
Challenge 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this challenge, we require a standalone project that will test your abilities with CoreAnimation as well as basic KVC & KVO skills. You are free to use any resources you’d like to make use of. | |
# Project specification | |
The project should be a universal application (iPhone & iPad) that is a showcase of a couple of animations. The idea is to have a way for the user of the application to select an animation, and a preview of that animation will be displayed continuously forever. You can assume that the number of animations is exactly two. No more, no less. | |
# Animation Details | |
The animations must utilize CAAnimation subclasses only. For simplicity, you may not use CAAnimation delegation methods “animationDidStart” and “animationDidStop”. The animating object must observe a model object’s changes using KVO. The model object is a simple NSObject subclass with some properties that are needed by the animation. Add an NSTimer in that class to vary the values from time to time using random or predetermined values from an NSArray. Any property of the animation not specified can be hardcoded. That object can be instantiated in the AppDelegate, or by the animating object, doesn’t matter. When a KVO kicks in, reset everything, and start animating with the new parameters. | |
## FIRST ANIMATION | |
This is a “pop in” animation. Object should begin with 0.3 scale and 0.05 opacity, and then animates in over a duration defined by the model object. The animation progresses as follows: | |
0%: Scale 0.3, opacity 0.05 | |
30%: Scale 1.2, opacity 1.0 | |
70%: Scale 0.9, | |
100%: Scale 1.0, | |
### BONUS | |
Make it look cool by easing the animations | |
## SECOND ANIMATION | |
This is a “slide and rotate” animation. The object should move X pixels along the x-axis from the center towards the center. X is defined by the model object. | |
0%: Position (superview.midpoint.x - model.startX, superview.midpoint.y), angle 0 | |
100%: Position (superview.midpoint.x, superview.midpoint.y), angle 0 (full 360º rotation) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment