Realm Cocoa 5.0 - Multithreading Support with Integration for SwiftUI & Combine

Hey All - we’ve released a blog post and demo app that details how to use RealmSwift’s Frozen Object implementation along with how to integrate with SwiftUI and Combine. Please have a look here:

We are eager to have you try it out and welcome your feedback



Sees to work a treat for getting a ‘live’ list of unique keywords from database records.

var subjects: Results<Asset> {
        return assets.sorted(byKeyPath: "subject").distinct(by: ["subject"])

    func filteredSubjectsCollection() -> AnyRealmCollection<Asset> {
            return AnyRealmCollection(self.subjects)

                // Subjects
                DisclosureGroup(isExpanded: $model.isSubjectsShowing) {
                    VStack(alignment:.trailing, spacing: 4) {
                        ForEach(filteredSubjectsCollection().freeze()) { asset in
                            CheckBoxSelection(label: asset.subject, isSelected: self.model.selectedSubjects.contains(asset.subject))
                                .onTapGesture { self.model.addSubject(subject: asset.subject) }
                    .padding(.leading, 20).padding(.trailing, 0)
                } label: {
                    HStack( {
                        Image(systemName: "flag")
                        CheckBoxSelection(label: "Subjects", isSelected: self.model.selectAllSubjects)
                            .onTapGesture { self.addAllSubjects() }
                    }.padding([.top, .bottom], 8).foregroundColor(.secondary)
                    .padding(.trailing, 1)