Skip to content

alexdioso/swift-data-in-executable-swift-package

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

This is an example of using SwiftData in an executable Swift Package.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages