Demo that shows how to use Realm with SwiftUI locally. Including the new property wrappers like @ObservedResults and @ObservedRealmObject
This is a demo project for Youtube tutorial
The app shows a list of Items which have a name property and isFavorite. Tapping on a list item will push to the detail view for this item. You can edit the name of the item. In the top right corner is a isFavorite button. Pressing on the delete button will delete the item and push back to the list view.
The order of the items can be changed and individuel items can be deleted with swip on delete.
@ObservedRealmObject var group: Group
@ObservedRealmObject var item: Item
@ObservedResults(Item.self) var items
@ObservedResults(Item.self, sortDescriptor: SortDescriptor.init(keyPath: "name", ascending: false)) var sortedItems