RealmOptional
public final class RealmOptional<T: RealmOptionalType>: RLMOptionalBase
A RealmOptional
instance represents a optional value for types that can’t be directly declared as dynamic
in Swift,
such as Int
, Float
, Double
, and Bool
.
To change the underlying value stored by a RealmOptional
instance, mutate the instance’s value
property.
-
The value this optional represents.
Declaration
Swift
public var value: T?
-
Creates a
RealmOptional
instance encapsulating the given default value.Declaration
Swift
public init(_ value: T? = nil)
Parameters
value
The value to store in the optional, or
nil
if not specified.