iOS Guides | Samples

UIKit.UICollisionBehavior Class

Detects boundary touches between IUIDynamicItems and boundaries or other IUIDynamicItems.

See Also: UICollisionBehavior


[Foundation.Register("UICollisionBehavior", true)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public class UICollisionBehavior : UIDynamicBehavior


IUIDynamicItems can be added and removed from the UICollisionBehavior.Items array dynamically.

Application developers should be aware that collision detection has a relatively high processor cost.

Related content


Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions:

The members of UIKit.UICollisionBehavior are listed below.

See Also: UIDynamicBehavior

Public Constructors

Default constructor, initializes a new instance of this class.

Protected Constructors

Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

BoundaryIdentifiersNSObject[]. The boundary identifiers to which the collision behavior is associated. Read-only.
ClassHandleIntPtr. The handle for this class.
CollisionDelegateIUICollisionBehaviorDelegate. The delegate object that receives events relating to collisions.
CollisionModeUICollisionBehaviorMode. Whether the UICollisionBehavior.Items should collide with boundaries, each other, or both.
ItemsIUIDynamicItem[]. The dynamic items added to this UICollisionBehavior.
TranslatesReferenceBoundsIntoBoundaryBoolean. Creates a set of boundaries based on the bounds of the reference view of the UIDynamicAnimator.
WeakCollisionDelegateNSObject. The delegate object used to respond to collisions.

Public Methods

AddBoundary(NSObject, UIBezierPath)
Creates a boundary defined by an approximation of the bezierPath.
AddBoundary(NSObject, CGPoint, CGPoint)
Creates a boundary defined by the provided end points.
Adds a dynamic item to this UICollisionBehavior's Items.
GetBoundary(NSObject) : UIBezierPath
Retrieves a boundary Bezier path.
Removes all collision boundaries from the UICollisionBehavior.
Removes a specific collision boundary from the collision behavior.
Removes the specified dynamic item from this UICollisionBehavior's Items.
Creates a set of boundaries inset from the bounds of the reference view of the UIDynamicAnimator.

Protected Methods

Releases the resources used by the UICollisionBehavior object.

Public Events

BeganBoundaryContactEvent raised by the object.
BeganContactEvent raised by the object.
EndedBoundaryContactEvent raised by the object.
EndedContactEvent raised by the object.