When you use SQLiteData there is no need to painstakingly mock your persistence layer: Xcode previews actually hit the database, and the library automatically supplies a mock CloudKit sync engine so you can easily preview how iCloud sharing looks in your UI.
Watch this week’s video to see how easy it is to build Xcode previews with SQLiteData: https://www.pointfree.co/episodes/ep351-tour-of-sqlitedata-previews