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.
-
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 } -
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 totruewhen 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
ValueAssistantobjects to provide support for some object types whose properties cannot be expressed directly with aKeyPath.Warning
This property should not be set directly, except by your own custom
ValueAssistant.Declaration
Swift
@MainActor public var stringPath: String -
A
KeyPathobject representing the property to be transformed.Declaration
Swift
@MainActor public var keyPath: AnyKeyPath? -
A
KeyPathobject 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
stringPathA string field only used internally to provide support for some object types whose properties cannot be expressed directly with a
KeyPath.startThe starting property value for a motion operation.
endThe ending property value for a motion operation.
-
A convenience initializer for
BinaryFloatingPointvalues 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 : BinaryFloatingPointParameters
keyPathA
KeyPathused to point to the property this object holds value states for.parentPathA
KeyPathused to point to the parent object of the property targeted by this object.startThe starting
BinaryFloatingPointproperty value for a motion operation.endThe ending
BinaryFloatingPointproperty value for a motion operation. -
A convenience initializer for
BinaryFloatingPointvalues.Declaration
Swift
@MainActor public convenience init<PropertyType>(keyPath: KeyPath<RootType, PropertyType>, start: PropertyType? = nil, end: PropertyType? = nil) where PropertyType : BinaryFloatingPointParameters
keyPathA
KeyPathused to point to the property this object holds value states for.startThe starting
BinaryFloatingPointproperty value for a motion operation.endThe ending
BinaryFloatingPointproperty value for a motion operation. -
A convenience initializer for
BinaryIntegervalues 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 : BinaryIntegerParameters
keyPathA
KeyPathused to point to the property this object holds value states for.parentPathA
KeyPathused to point to the parent object of the property targeted by this object.startThe starting
BinaryIntegerproperty value for a motion operation.endThe ending
BinaryIntegerproperty value for a motion operation. -
A convenience initializer for
BinaryIntegervalues.Declaration
Swift
@MainActor public convenience init<PropertyType>(keyPath: KeyPath<RootType, PropertyType>, start: PropertyType? = nil, end: PropertyType? = nil) where PropertyType : BinaryIntegerParameters
keyPathA
KeyPathused to point to the property this object holds value states for.startThe starting
BinaryIntegerproperty value for a motion operation.endThe ending
BinaryIntegerproperty value for a motion operation. -
Applies the provided value to the object referenced by the
keyPathproperty.Declaration
Swift
@MainActor public func apply(value: any BinaryFloatingPoint, to: RootType)Parameters
valueThe value to set on the object.
objectThe root object for the keypath, used to apply the value to.
-
Applies the provided value to the
SIMDtype object referenced by thekeyPathproperty.Declaration
Swift
@MainActor public func applyToSIMD(value: any BinaryFloatingPoint, to object: RootType)Parameters
valueThe value to set on the
SIMDobject.objectThe 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
parentPathkeypath.Declaration
Swift
@MainActor public func applyToParent(value: Any, to object: RootType)Parameters
valueThe value to set on the parent object.
objectThe root object for the
parentPathkeypath, used to apply the value to. -
Retrieves a value from the provided object using the
keyPathproperty.Declaration
Swift
@MainActor public func retrieveValue(from target: RootType) -> Any?Parameters
targetThe 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
parentPathproperty.Declaration
Swift
@MainActor public func retrieveParentValue(from target: RootType) -> Any?Parameters
targetThe 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)
View on GitHub