RealmOptional
A RealmOptional
represents a optional value for types that can’t be directly
declared as dynamic
in Swift, such as Int
s, Float
, Double
, and Bool
.
It encapsulates a value in its value
property, which is the only way to mutate
a RealmOptional
property on an Object
.
-
The value this optional represents.
Declaration
Swift
public var value: T?
-
Creates a
RealmOptional
with the given default value (defaults tonil
).Declaration
Swift
public init(_ value: T? = nil)
Parameters
value
The default value for this optional.