# 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")
    }

### Required

- `Required`

  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, including `lazy` and `weak` properties.
  See more

  #### Declaration

  Swift

      public final class Required<V> : AttributeKeyPathStringConvertible, AttributeProtocol where V : ImportableAttributeType

### Optional

- `Optional`

  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, including `lazy` and `weak` properties.
  See more

  #### Declaration

  Swift

      public final class Optional<V> : AttributeKeyPathStringConvertible, AttributeProtocol where V : ImportableAttributeType