ValueContainer
public enum ValueContainer<O> where O : CoreStoreObject
The containing type for value properties. Use the DynamicObject.Value
typealias instead for shorter syntax.
class Animal: CoreStoreObject {
let species = Value.Required<String>("species", initial: "")
let nickname = Value.Optional<String>("nickname")
let color = Transformable.Optional<UIColor>("color")
}
-
The containing type for required value properties. Any type that conforms to
ImportableAttributeType
are supported.class Animal: CoreStoreObject { let species = Value.Required<String>("species", initial: "") let nickname = Value.Optional<String>("nickname") let color = Transformable.Optional<UIColor>("color") }
Important
Value.Required
properties are required to be stored properties. Computed properties will be ignored, includinglazy
andweak
properties.Declaration
Swift
public final class Required<V> : AttributeKeyPathStringConvertible, AttributeProtocol where V : ImportableAttributeType
-
The containing type for optional value properties. Any type that conforms to
ImportableAttributeType
are supported.class Animal: CoreStoreObject { let species = Value.Required<String>("species", initial: "") let nickname = Value.Optional<String>("nickname") let color = Transformable.Optional<UIColor>("color") }
Important
Value.Optional
properties are required to be stored properties. Computed properties will be ignored, includinglazy
andweak
properties.Declaration
Swift
public final class Optional<V> : AttributeKeyPathStringConvertible, AttributeProtocol where V : ImportableAttributeType