iOS Developer Library — Prerelease

Developer

UIKit Framework Reference UIDynamicItem Protocol Reference

Options
Deployment Target:

On This Page
Language:

UIDynamicItem

To make a custom object eligible to participate in UIKit Dynamics, adopt the UIDynamicItem protocol in the object’s class.

Starting in iOS 7, the UIView and UICollectionViewLayoutAttributes classes implement this protocol.

  • bounds bounds Required Property

    Called when a dynamic animator needs the bounds of the dynamic item. (read-only)

    Declaration

    Swift

    var bounds: CGRect { get }

    Objective-C

    @property(nonatomic, readonly) CGRect bounds

    Availability

    Available in iOS 7.0 and later.

  • center center Required Property

    The center point of the dynamic item.

    Declaration

    Swift

    var center: CGPoint { get set }

    Objective-C

    @property(nonatomic, readwrite) CGPoint center

    Discussion

    The dynamic animator (that the item is associated with) calls this method when it has computed a new center point for the item.

    Availability

    Available in iOS 7.0 and later.

  • transform transform Required Property

    The rotation of the dynamic item.

    Declaration

    Swift

    var transform: CGAffineTransform { get set }

    Objective-C

    @property(nonatomic, readwrite) CGAffineTransform transform

    Discussion

    UIKit Dynamics makes use only of the rotation value in this property.

    The dynamic animator (that the item is associated with) calls this method when it has computed a new rotation value for the item.

    Availability

    Available in iOS 7.0 and later.