ResultsSection

public struct ResultsSection<Key, T> : SectionedResultImpl where Key : _Persistable, Key : Hashable, T : RealmCollectionValue
extension ResultsSection: RealmSubscribable
extension ResultsSection: Identifiable

ResultsSection is a collection which allows access to objects that belong to a given section key. The collection is lazily evaluated, meaning that if the underlying collection has changed a full recalculation of the section keys will take place. A ResultsSection instance can be observed and it also conforms to ThreadConfined.

  • Declaration

    Swift

    public typealias Element = T
  • key

    The key which represents this section.

    Declaration

    Swift

    public var key: Key { get }
  • Returns the object at the given index.

    Declaration

    Swift

    public subscript(index: Int) -> T { get }

    Parameters

    index

    The index.

Sectioned Results

  • A publisher that emits Void each time the results section collection changes.

    Despite the name, this actually emits after the results section collection has changed.

    Declaration

    Swift

    public var objectWillChange: RealmPublishers.WillChange<ResultsSection> { get }
  • A publisher that emits the results section collection each time the results section collection changes.

    Declaration

    Swift

    public var collectionPublisher: RealmPublishers.Value<`Self`> { get }
  • A publisher that emits the results section collection each time the results section collection changes on the given property keyPaths.

    Declaration

    Swift

    public func collectionPublisher(keyPaths: [String]?) -> RealmPublishers.Value<`Self`>
  • A publisher that emits a results section collection changeset each time the results section collection changes.

    Declaration

    Swift

    public var changesetPublisher: RealmPublishers.SectionChangeset<`Self`> { get }
  • A publisher that emits a results section collection changeset each time the results section collection changes on the given property keyPaths.

    Declaration

    Swift

    public func changesetPublisher(keyPaths: [String]?) -> RealmPublishers.SectionChangeset<`Self`>