DittoDocument
@objc
public class DittoDocument : NSObject
A document belonging to a DittoCollection
with an inner value.
-
The ID of the document.
Declaration
Swift
@objc public let _id: String
-
The document’s inner value.
Declaration
Swift
public lazy var value: [String : Any?] { get set }
-
Return a typed document where the document’s inner value is decoded into an object of the provided type.
Throws
DittoKitError
.Precondition
The type provided must conform toCodable
.Declaration
Swift
public func typed<T>(as type: T.Type) throws -> DittoTypedDocument<T> where T : Decodable, T : Encodable
Parameters
type
The type to use to decode the document’s inner value.
Return Value
A
DittoTypedDocument
whose inner value has been decoded into an object of the provided type. -
Used to specify a path to a key in the document that you can subscript further to access a nested key in the document.
Declaration
Swift
@objc public subscript(key: String) -> DittoDocumentPath { get }
Parameters
key
The initial part of the path needed to get to the key in the document you wish to get the value of.
Return Value
The same
DittoDocumentPath
object with the provided key incorporated into the document path.
-
Undocumented
Declaration
Swift
public override var description: String { get }
-
Undocumented
Declaration
Swift
public override var debugDescription: String { get }