SectionedResults
public struct SectionedResults<Key, SectionElement> : SectionedResultImpl where Key : _Persistable, Key : Hashable, SectionElement : RealmCollectionValue
extension SectionedResults: RealmSubscribable
SectionedResults
是一个类型安全的collection,其中包含单个ResultsSection
作为其元素。container是延迟评估的,这意味着如果底层collection发生更改,则会对部分键进行完全重新计算。可以观察SectionedResults
实例,并且它也符合ThreadConfined
。
-
声明
Swift
public typealias Element = ResultsSection<Key, SectionElement>
-
分段结果collection中所有键的数组。
声明
Swift
public var allKeys: [Key] { get }
-
返回给定
index
处的部分。声明
Swift
public subscript(index: Int) -> Element { get }
参数
index
索引。
-
返回给定
IndexPath
处的对象。声明
Swift
public subscript(indexPath: IndexPath) -> SectionElement { get }
参数
indexPath
IndexPath。
-
每次分段结果collection发生变化时发出 Void 的发布者。
尽管有这个名称,但它实际上是在分段结果collection发生更改后发出的。
声明
Swift
public var objectWillChange: RealmPublishers.WillChange<SectionedResults> { get }
-
每次分段结果集合发生更改时发出分段结果集合的发布者。
声明
Swift
public var collectionPublisher: RealmPublishers.Value<`Self`> { get }
-
每当给定属性 keyPaths 上的分段结果集合发生变化时,发布者都会发出分段结果集合。
声明
Swift
public func collectionPublisher(keyPaths: [String]?) -> RealmPublishers.Value<`Self`>
-
每次分段结果集合发生更改时发出分段结果集合变更集的发布者。
声明
Swift
public var changesetPublisher: RealmPublishers.SectionedResultsChangeset<`Self`> { get }
-
每当给定属性 keyPaths 上的分段collection发生更改时,发布者会发出分段collection变更集。
声明
Swift
public func changesetPublisher(keyPaths: [String]?) -> RealmPublishers.SectionedResultsChangeset<`Self`>