I looked through the documentation, and I am ashamed to say that I am confused.
Scenario :
I have a UIView that acts as a container for 3 UIButtons . This container initially has borders {0, 0, 35, 35} , with each button inside with the same coordinates (with alpha 0). For a specific user action, the container changes its borders to {0, 0, 100, 35} , and the button is animated in x-origin 5, 35 and 65, respectively, using alpha 1, so that they spread inside the resized container. I see this as an extended state of the container. The same user action switches it back to its original compressed state.
Purpose :
I am currently doing this using the [UIView animateWithDuration:] block, but would like to use UIDynamicAnimator to add a bouncy effect, so when I switch to the expanded state, the container resizes with a rollback (resizes a bit more, and bounces back to the target borders) , as well as the buttons bounce (move a little further and return to the target borders).
The Confusion :
UIDynamicAnimator , UIDynamicBehavior , UIAttachmentBehavior , UIDynamicItem ..... all this makes my understanding of UIKitDynamic overflow. I think I should use UISnapBehavior , but I do not know how to do this.
ios uiview uikit-dynamics uidynamicanimator
n00bProgrammer Apr 17 '14 at 5:36 on 2014-04-17 05:36
source share