- behaviors
- Behaviors that you want to add to the animator
The following example shows how you can add a couple of behaviors to an animator:
C# Example
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
var gravityBehavior = new UIGravityBehavior (square);
var collisionBehavior = new UICollisionBehavior (square) {
TranslatesReferenceBoundsIntoBoundary = true
};
collisionBehavior.BeganBoundaryContact += BeganContact;
collisionBehavior.EndedBoundaryContact += EndedContact;
animator = new UIDynamicAnimator (View);
// Add the two behaviors at once
animator.AddBehaviors (gravityBehavior, collisionBehavior);
}