ObservedSectionedResults

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
@propertyWrapper
public struct ObservedSectionedResults<Key, ResultType> : DynamicProperty, BoundCollection where Key : _Persistable, Key : Hashable, ResultType : KeypathSortable, ResultType : RealmFetchable, ResultType : _ObservedResultsValue, ResultType : Identifiable

섹션으로 구분된 결과 collection을 나타내는 속성 래퍼 유형입니다.

섹션화된 결과는 이니셜라이저에 configuration 이(가) 설정되지 않은 경우 환경 값 realmConfiguration 에서 제공하는 영역 구성을 사용합니다.

@ObservedSectionedResults var v SwiftUI에서 이$v 주어지면 은 BoundCollection 를 나타냅니다.

  • 선언

    스위프트

    public typealias Element = ResultType
  • SectionedResults를 필터링하는 데 사용되는 NSPredicate를 저장합니다. 이는 where 매개변수와 상호 배타적입니다.

    선언

    스위프트

    @State
    public var filter: NSPredicate? { get nonmutating set }
  • SectionedResults를 필터링하는 데 사용되는 형식 안정 쿼리를 저장합니다. 이는 filter 매개변수와 상호 배타적입니다.

    선언

    스위프트

    @State
    public var `where`: ((Query<ResultType>) -> Query<Bool>)? { get nonmutating set }
  • 지정된 IndexSetResultsSection 가 있는 @ObservedSectionedResults 컬렉션에서 항목을 제거합니다.

    선언

    스위프트

    public func remove(atOffsets offsets: IndexSet,
                       section: ResultsSection<Key, ResultType>) where ResultType: ObjectBase & ThreadConfined

    매개변수

    offsets

    섹션의 인덱스 오프셋입니다.

    section

    제거할 항목이 포함된 섹션입니다.

  • 지정된 Projection 유형에 대한 ObservedSectionedResults 구조체를 초기화합니다.

    참고

    프라이머리 정렬 설명자는 섹션 키 결정을 담당해야 합니다.

    선언

    스위프트

    public init<ObjectType: ObjectBase>(_ type: ResultType.Type,
                                        sectionKeyPath: KeyPath<ResultType, Key>,
                                        sortDescriptors: [SortDescriptor] = [],
                                        filter: NSPredicate? = nil,
                                        keyPaths: [String]? = nil,
                                        configuration: Realm.Configuration? = nil) where ResultType: Projection<ObjectType>, ObjectType: ThreadConfined

    매개변수

    type

    관찰된 유형

    sectionKeyPath

    각 섹션의 키를 생성할 keyPath입니다. keyPath에서 검색된 모든 고유 값에 대해 섹션 키가 생성됩니다.

    sortDescriptors

    정렬 기준이 되는 SortDescriptor의 시퀀스입니다.

    filter

    통과하는 객체에 대해서만 관찰이 수행됩니다. 필터를 지정하지 않으면 모든 객체가 관찰됩니다.

    keyPaths

    키 경로 배열에 포함된 속성만 관찰됩니다. nil 인 경우 객체의 속성 변경에 대한 알림이 전달됩니다. 유효한 속성에 해당하지 않는 문자열 키 경로는 예외를 발생시킵니다.

    configuration

    Realm을 만들 때 사용되는 Realm.Configuration 입니다. 비어 있으면 구성이 defaultConfiguration로 설정됩니다.

  • 지정된 Projection 유형에 대한 ObservedSectionedResults 구조체를 초기화합니다.

    참고

    프라이머리 정렬 설명자는 섹션 키 결정을 담당해야 합니다.

    선언

    스위프트

    public init<ObjectType: ObjectBase>(_ type: ResultType.Type,
                                        sectionBlock: @escaping ((ResultType) -> Key),
                                        sortDescriptors: [SortDescriptor] = [],
                                        filter: NSPredicate? = nil,
                                        keyPaths: [String]? = nil,
                                        configuration: Realm.Configuration? = nil) where ResultType: Projection<ObjectType>, ObjectType: ThreadConfined

    매개변수

    type

    관찰된 유형

    sectionBlock

    collection의 각 객체에 대한 섹션 키를 반환하는 콜백입니다.

    sortDescriptors

    정렬 기준이 되는 SortDescriptor의 시퀀스입니다.

    filter

    통과하는 객체에 대해서만 관찰이 수행됩니다. 필터를 지정하지 않으면 모든 객체가 관찰됩니다.

    keyPaths

    키 경로 배열에 포함된 속성만 관찰됩니다. nil 인 경우 객체의 속성 변경에 대한 알림이 전달됩니다. 유효한 속성에 해당하지 않는 문자열 키 경로는 예외를 발생시킵니다.

    configuration

    Realm을 만들 때 사용되는 Realm.Configuration 입니다. 비어 있으면 구성이 defaultConfiguration로 설정됩니다.

  • 지정된 Object 또는 EmbeddedObject 유형에 대한 ObservedSectionedResults 구조체를 초기화합니다.

    참고

    프라이머리 정렬 설명자는 섹션 키 결정을 담당해야 합니다.

    선언

    스위프트

    public init(_ type: ResultType.Type,
                sectionKeyPath: KeyPath<ResultType, Key>,
                sortDescriptors: [SortDescriptor] = [],
                filter: NSPredicate? = nil,
                keyPaths: [String]? = nil,
                configuration: Realm.Configuration? = nil) where ResultType: Object

    매개변수

    type

    관찰된 유형

    sectionKeyPath

    각 섹션의 키를 생성할 keyPath입니다. keyPath에서 검색된 모든 고유 값에 대해 섹션 키가 생성됩니다.

    sortDescriptors

    정렬 기준이 되는 SortDescriptor의 시퀀스입니다.

    filter

    통과하는 객체에 대해서만 관찰이 수행됩니다. 필터를 지정하지 않으면 모든 객체가 관찰됩니다.

    keyPaths

    키 경로 배열에 포함된 속성만 관찰됩니다. nil 인 경우 객체의 속성 변경에 대한 알림이 전달됩니다. 유효한 속성에 해당하지 않는 문자열 키 경로는 예외를 발생시킵니다.

    configuration

    Realm을 만들 때 사용되는 Realm.Configuration 입니다. 비어 있으면 구성이 defaultConfiguration로 설정됩니다.

  • 지정된 Object 또는 EmbeddedObject 유형에 대한 ObservedSectionedResults 구조체를 초기화합니다.

    참고

    프라이머리 정렬 설명자는 섹션 키 결정을 담당해야 합니다.

    선언

    스위프트

    public init(_ type: ResultType.Type,
                sectionBlock: @escaping ((ResultType) -> Key),
                sortDescriptors: [SortDescriptor] = [],
                filter: NSPredicate? = nil,
                keyPaths: [String]? = nil,
                configuration: Realm.Configuration? = nil) where ResultType: Object

    매개변수

    type

    관찰된 유형

    sectionBlock

    collection의 각 객체에 대한 섹션 키를 반환하는 콜백입니다.

    sortDescriptors

    정렬 기준이 되는 SortDescriptor의 시퀀스입니다.

    filter

    통과하는 객체에 대해서만 관찰이 수행됩니다. 필터를 지정하지 않으면 모든 객체가 관찰됩니다.

    keyPaths

    키 경로 배열에 포함된 속성만 관찰됩니다. nil 인 경우 객체의 속성 변경에 대한 알림이 전달됩니다. 유효한 속성에 해당하지 않는 문자열 키 경로는 예외를 발생시킵니다.

    configuration

    Realm을 만들 때 사용되는 Realm.Configuration 입니다. 비어 있으면 구성이 defaultConfiguration로 설정됩니다.

  • 지정된 Object 또는 EmbeddedObject 유형에 대한 ObservedSectionedResults 구조체를 초기화합니다.

    참고

    프라이머리 정렬 설명자는 섹션 키 결정을 담당해야 합니다.

    선언

    스위프트

    public init(_ type: ResultType.Type,
                sectionBlock: @escaping ((ResultType) -> Key),
                sortDescriptors: [SortDescriptor] = [],
                where: ((Query<ResultType>) -> Query<Bool>)? = nil,
                keyPaths: [String]? = nil,
                configuration: Realm.Configuration? = nil) where ResultType: Object

    매개변수

    type

    관찰된 유형

    sectionBlock

    collection의 각 객체에 대한 섹션 키를 반환하는 콜백입니다.

    sortDescriptors

    정렬 기준이 되는 SortDescriptor의 시퀀스입니다.

    where

    통과하는 객체에 대해서만 관찰이 수행됩니다. 유형 안전 쿼리가 제공되지 않으면 모든 객체가 관찰됩니다.

    keyPaths

    키 경로 배열에 포함된 속성만 관찰됩니다. nil 인 경우 객체의 속성 변경에 대한 알림이 전달됩니다. 유효한 속성에 해당하지 않는 문자열 키 경로는 예외를 발생시킵니다.

    configuration

    Realm을 만들 때 사용되는 Realm.Configuration 입니다. 비어 있으면 구성이 defaultConfiguration로 설정됩니다.

  • 지정된 Object 또는 EmbeddedObject 유형에 대한 ObservedSectionedResults 구조체를 초기화합니다.

    참고

    프라이머리 정렬 설명자는 섹션 키 결정을 담당해야 합니다.

    선언

    스위프트

    public init(_ type: ResultType.Type,
                sectionKeyPath: KeyPath<ResultType, Key>,
                sortDescriptors: [SortDescriptor] = [],
                where: ((Query<ResultType>) -> Query<Bool>)? = nil,
                keyPaths: [String]? = nil,
                configuration: Realm.Configuration? = nil) where ResultType: Object

    매개변수

    type

    관찰된 유형

    sectionKeyPath

    각 섹션의 키를 생성할 keyPath입니다. keyPath에서 검색된 모든 고유 값에 대해 섹션 키가 생성됩니다.

    sortDescriptors

    정렬 기준이 되는 SortDescriptor의 시퀀스입니다.

    where

    통과하는 객체에 대해서만 관찰이 수행됩니다. 유형 안전 쿼리가 제공되지 않으면 모든 객체가 관찰됩니다.

    keyPaths

    키 경로 배열에 포함된 속성만 관찰됩니다. nil 인 경우 객체의 속성 변경에 대한 알림이 전달됩니다. 유효한 속성에 해당하지 않는 문자열 키 경로는 예외를 발생시킵니다.

    configuration

    Realm을 만들 때 사용되는 Realm.Configuration 입니다. 비어 있으면 구성이 defaultConfiguration로 설정됩니다.

  • 지정된 Object 또는 EmbeddedObject 유형에 대한 ObservedSectionedResults 구조체를 초기화합니다.

    참고

    프라이머리 정렬 설명자는 섹션 키 결정을 담당해야 합니다.

    선언

    스위프트

    public init(_ type: ResultType.Type,
                sectionKeyPath: KeyPath<ResultType, Key>,
                sortDescriptors: [SortDescriptor] = [],
                keyPaths: [String]? = nil,
                configuration: Realm.Configuration? = nil) where ResultType: Object

    매개변수

    type

    관찰된 유형

    sectionKeyPath

    각 섹션의 키를 생성할 keyPath입니다. keyPath에서 검색된 모든 고유 값에 대해 섹션 키가 생성됩니다.

    sortDescriptors

    정렬 기준이 되는 SortDescriptor의 시퀀스입니다.

    keyPaths

    키 경로 배열에 포함된 속성만 관찰됩니다. nil 인 경우 객체의 속성 변경에 대한 알림이 전달됩니다. 유효한 속성에 해당하지 않는 문자열 키 경로는 예외를 발생시킵니다.

    configuration

    Realm을 만들 때 사용되는 Realm.Configuration 입니다. 비어 있으면 구성이 defaultConfiguration로 설정됩니다.

  • 지정된 Object 또는 EmbeddedObject 유형에 대한 ObservedSectionedResults 구조체를 초기화합니다.

    참고

    프라이머리 정렬 설명자는 섹션 키 결정을 담당해야 합니다.

    선언

    스위프트

    public init(_ type: ResultType.Type,
                sectionBlock: @escaping ((ResultType) -> Key),
                sortDescriptors: [SortDescriptor],
                keyPaths: [String]? = nil,
                configuration: Realm.Configuration? = nil) where ResultType: Object

    매개변수

    type

    관찰된 유형

    sectionBlock

    collection의 각 객체에 대한 섹션 키를 반환하는 콜백입니다.

    sortDescriptors

    정렬 기준이 되는 SortDescriptor의 시퀀스입니다.

    keyPaths

    키 경로 배열에 포함된 속성만 관찰됩니다. nil 인 경우 객체의 속성 변경에 대한 알림이 전달됩니다. 유효한 속성에 해당하지 않는 문자열 키 경로는 예외를 발생시킵니다.

    configuration

    Realm을 만들 때 사용되는 Realm.Configuration 입니다. 비어 있으면 구성이 defaultConfiguration로 설정됩니다.

  • 선언

    스위프트

    nonisolated public func update()