Pages

Showing posts with label Animation. Show all posts
Showing posts with label Animation. Show all posts

Adding Collision Behavior && Gravity Behavior to UI contents

As you guys know Collision && Gravity are both terms of Physics. But with the Apple's new technology UI Dynamics you can add these behaviors to your UI components like Buttons, Labels, or even to the views etc. Apple divided different actions related to animations into different behavior classes. And these behavior classes works with animators , means you can attach different behavior to an animator. For example, you added gravity behavior to the Label so that it will fall from the point you specified to all the way to the bottom && when it reaches to the boundary it will out of the screen && you will not be able to see it. So if you want that label to stop being disappear you will add the collision behavior to the label && define a boundary so that after colliding to it label will not disappear && will stay on the screen.

Different classes that provides different behavior: 
a.)UICollisionBehavior
b.)UIGravityBehavior
c.)UIPushBehavior
d.)UISnapBehavior