PropertyData

@MainActor
public final class PropertyData<RootType> : Identifiable
extension PropertyData: Equatable
extension PropertyData: Hashable

This class represents a single property and information about the state of its value interpolation, as well as metadata such as the KeyPath which allows a motion class to get and set these values.

  • id

    A unique identifier.

    Declaration

    Swift

    @MainActor
    public let id: UUID
  • A placeholder default value when a start value is not provided.

    Declaration

    Swift

    @MainActor
    public let DEFAULT_START: Double
  • The starting value of the motion operation.

    Declaration

    Swift

    @MainActor
    internal(set) public var start: Double { get set }
  • The current value of the motion operation. (read-only)

    Declaration

    Swift

    @MainActor
    internal(set) public var current: Double { get }
  • end

    The ending value of the motion operation.

    Declaration

    Swift

    @MainActor
    internal(set) public var end: Double { get }
  • If true, a Moveable class should use the object’s property’s current value as the starting value.

    Remark

    This is set to true when no value is passed into the initializer’s start property.

    Declaration

    Swift

    @MainActor
    internal(set) public var useExistingStartValue: Bool { get }
  • The target object whose property should be modified.

    Declaration

    Swift

    @MainActor
    public var targetObject: RootType?
  • A string field only used internally by some ValueAssistant objects to provide support for some object types whose properties cannot be expressed directly with a KeyPath.

    Warning

    This property should not be set directly, except by your own custom ValueAssistant.

    Declaration

    Swift

    @MainActor
    public var stringPath: String
  • A KeyPath object representing the property to be transformed.

    Declaration

    Swift

    @MainActor
    public var keyPath: AnyKeyPath?
  • A KeyPath object representing the parent object of the property to be transformed. This keypath is used in cases where object properties are read-only or otherwise not directly modifiable.

    Declaration

    Swift

    @MainActor
    public var parentPath: AnyKeyPath?
  • The property to be modified.

    Declaration

    Swift

    @MainActor
    public var target: AnyObject?
  • The change in value from the last property value update.

    Declaration

    Swift

    @MainActor
    internal(set) public var delta: Double { get }
  • A delegate that listens for property updates from this instance.

    Declaration

    Swift

    @MainActor
    public weak var delegate: PropertyDataDelegate?
  • An initializer.

    Declaration

    Swift

    @MainActor
    public convenience init<ParentType>(stringPath: String?, parentPath: KeyPath<RootType, ParentType>? = nil, start: Double? = nil, end: Double)

    Parameters

    stringPath

    A string field only used internally to provide support for some object types whose properties cannot be expressed directly with a KeyPath.

    start

    The starting property value for a motion operation.

    end

    The ending property value for a motion operation.

  • A convenience initializer for BinaryFloatingPoint values that includes a parent keypath.

    Declaration

    Swift

    @MainActor
    public convenience init<PropertyType, ParentType>(keyPath: KeyPath<RootType, PropertyType>, parentPath: KeyPath<RootType, ParentType>? = nil, start: PropertyType? = nil, end: PropertyType) where PropertyType : BinaryFloatingPoint

    Parameters

    keyPath

    A KeyPath used to point to the property this object holds value states for.

    parentPath

    A KeyPath used to point to the parent object of the property targeted by this object.

    start

    The starting BinaryFloatingPoint property value for a motion operation.

    end

    The ending BinaryFloatingPoint property value for a motion operation.

  • A convenience initializer for BinaryFloatingPoint values.

    Declaration

    Swift

    @MainActor
    public convenience init<PropertyType>(keyPath: KeyPath<RootType, PropertyType>, start: PropertyType? = nil, end: PropertyType? = nil) where PropertyType : BinaryFloatingPoint

    Parameters

    keyPath

    A KeyPath used to point to the property this object holds value states for.

    start

    The starting BinaryFloatingPoint property value for a motion operation.

    end

    The ending BinaryFloatingPoint property value for a motion operation.

  • A convenience initializer for BinaryInteger values that includes a parent keypath.

    Declaration

    Swift

    @MainActor
    public convenience init<PropertyType, ParentType>(keyPath: KeyPath<RootType, PropertyType>, parentPath: KeyPath<RootType, ParentType>? = nil, start: PropertyType? = nil, end: PropertyType? = nil) where PropertyType : BinaryInteger

    Parameters

    keyPath

    A KeyPath used to point to the property this object holds value states for.

    parentPath

    A KeyPath used to point to the parent object of the property targeted by this object.

    start

    The starting BinaryInteger property value for a motion operation.

    end

    The ending BinaryInteger property value for a motion operation.

  • A convenience initializer for BinaryInteger values.

    Declaration

    Swift

    @MainActor
    public convenience init<PropertyType>(keyPath: KeyPath<RootType, PropertyType>, start: PropertyType? = nil, end: PropertyType? = nil) where PropertyType : BinaryInteger

    Parameters

    keyPath

    A KeyPath used to point to the property this object holds value states for.

    start

    The starting BinaryInteger property value for a motion operation.

    end

    The ending BinaryInteger property value for a motion operation.

  • Applies the provided value to the object referenced by the keyPath property.

    Declaration

    Swift

    @MainActor
    public func apply(value: any BinaryFloatingPoint, to: RootType)

    Parameters

    value

    The value to set on the object.

    object

    The root object for the keypath, used to apply the value to.

  • Applies the provided value to the SIMD type object referenced by the keyPath property.

    Declaration

    Swift

    @MainActor
    public func applyToSIMD(value: any BinaryFloatingPoint, to object: RootType)

    Parameters

    value

    The value to set on the SIMD object.

    object

    The root object for the keypath, used to apply the value to.

    Return Value

    The resultant object’s value, if one was set.

  • Applies the provided value to the parent object referenced by the parentPath keypath.

    Declaration

    Swift

    @MainActor
    public func applyToParent(value: Any, to object: RootType)

    Parameters

    value

    The value to set on the parent object.

    object

    The root object for the parentPath keypath, used to apply the value to.

  • Retrieves a value from the provided object using the keyPath property.

    Declaration

    Swift

    @MainActor
    public func retrieveValue(from target: RootType) -> Any?

    Parameters

    target

    The target object to retrieve a value from.

    Return Value

    The result of the keypath retrieval, if one was found.

  • Retrieves a value from the provided object using the parentPath property.

    Declaration

    Swift

    @MainActor
    public func retrieveParentValue(from target: RootType) -> Any?

    Parameters

    target

    The target object to retrieve a value from.

    Return Value

    The result of the keypath retrieval, if one was found.

  • Declaration

    Swift

    nonisolated public static func == (lhs: PropertyData, rhs: PropertyData) -> Bool
  • Declaration

    Swift

    nonisolated public func hash(into hasher: inout Hasher)