Posts

Post marked as solved
8 Replies
1.5k Views
Hello, I was researching an interesting problem related to Swift Packages but I'm not able to find the solution so, here we go!Here is the scenario:- Create an empty project in Xcode for iOS app.- Import Swift Package: https://bitbucket.org/janmazurczak/seed- In AppDelegate import Seed- In AppDelegate.didFinishLaunching paste this:let someSeed = TimeSeed<UInt32>(sliceDuration: 15, modifier: "seedModifier", date: Date())- Run and observe a crashAnd then:- Remove Swift Package dependency- Go to package repo, download swift files and paste them in the project, like it is regular part of the project, without packages importing.- In AppDelegate remove import Seed- Run and observe NO crash.Expected:The same code should work via packages the same way.Note about modularity:Because Swift Package is a separate module it should respect public/internal/private differently than files dropped into the project directly so to check this I've created a Framework locally and added it to the workspace to mimic separate module. The results I've observed were that everything compiled and run fine, so problem is definetely related to Swift Packages.Note about other packages:I tried to import another packages created by me an I experienced the same problem so maybe package manifest file is where I made a mistake.Any thoughts?
Posted Last updated
.