iOS Guides | Samples

UIKit.UICollisionBehavior Class

Detects boundary touches between IUIDynamicItems and boundaries or other IUIDynamicItems.

See Also: UICollisionBehavior

Syntax

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

Remarks

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

Requirements

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

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

[read-only]
BoundaryIdentifiersNSObject[]. The boundary identifiers to which the collision behavior is associated. Read-only.
[read-only]
override
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.
[read-only]
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.
AddItem(IUIDynamicItem)
Adds a dynamic item to this UICollisionBehavior's Items.
GetBoundary(NSObject) : UIBezierPath
Retrieves a boundary Bezier path.
RemoveAllBoundaries()
Removes all collision boundaries from the UICollisionBehavior.
RemoveBoundary(NSObject)
Removes a specific collision boundary from the collision behavior.
RemoveItem(IUIDynamicItem)
Removes the specified dynamic item from this UICollisionBehavior's Items.
SetTranslatesReferenceBoundsIntoBoundaryWithInsets(UIEdgeInsets)
Creates a set of boundaries inset from the bounds of the reference view of the UIDynamicAnimator.

Protected Methods

override
Dispose(Boolean)
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.