iOS Developer Library

Developer

UIKit Framework Reference UIDynamicItem Protocol Reference

Options
Deployment Target:

On This Page
Language:

UIDynamicItem

Inheritance


Not Applicable

Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 7.0 and later.

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 Property

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

    Declaration

    Swift

    var bounds: CGRect { get }

    Objective-C

    @property(nonatomic, readonly) CGRect bounds

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • center center Required Property

    The center point of the dynamic item. (required)

    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.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • transform transform Required Property

    The rotation of the dynamic item. (required)

    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.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.