Skip to content

Latest commit

 

History

History
6 lines (6 loc) · 717 Bytes

File metadata and controls

6 lines (6 loc) · 717 Bytes

swift-data-in-executable-swift-package

This is an example of using SwiftData in an executable Swift Package. SwiftData uses Bundle.main.bundleIdentifier and when it can't find it, like in an executable Swift Package, it throws this error:

SwiftData/DataStoreCoreData.swift:32: Fatal error: Unable to determine Bundle Name

The solution is to create an Info.plist with at least a Bundle Identifier and then link that into the executable. This example also changes the default storage location which is the same for all macOS SwiftData applications.