public protocol FailableCustomPersistable : _CustomPersistable
A type which can be mapped to and from a type which Realm supports.
This protocol is identical to CustomPersistable
, except with init?(persistedValue:)
instead of init(persistedValue:)
.
FailableCustomPersistable types are force-unwrapped in non-Optional contexts, and collapsed to nil
in Optional contexts. That is, if you have a value that can’t be converted to a URL, reading a @Persisted var url: URL
property will throw an unwrapped failed exception, and reading from Persisted var url: URL?
will return nil
.
Construct an instance of the this type from the persisted type, returning nil if the conversion is not possible.
This function must not return nil
when given a default-initalized PersistedType()
.
Swift
init?(persistedValue: PersistedType)
Construct an instance of the persisted type from this type.
DeclarationSwift
var persistableValue: PersistedType { get }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4