Fragment

public class Fragment: ReadOnlyFragment, DictionaryFragment, ArrayFragment

Fragment provides read and write access to data value. Fragment also provides subscript access by either key or index to the nested values which are wrapped by Fragment objects.

  • Gets the value from or sets the value to the fragment object. The object types are ArrayObject, Blob, DictionaryObject, Number, String, NSNull, or nil

    Declaration

    Swift

    public override var value: Any?
  • Get the value as an ArrayObject object, a mapping object of an array value. Returns nil if the value is nil, or the value is not an array.

    Declaration

    Swift

    public override var array: ArrayObject?
  • Get a property’s value as a DictionaryObject object, a mapping object of a dictionary value. Returns nil if the value is nil, or the value is not a dictionary.

    Declaration

    Swift

    public override var dictionary: DictionaryObject?
  • Subscript access to a CBLFragment object by index.

    Declaration

    Swift

    public override subscript(index: Int) -> Fragment

    Parameters

    index

    The index.

  • Subscript access to a CBLFragment object by key.

    Declaration

    Swift

    public override subscript(key: String) -> Fragment

    Parameters

    key

    The key.