I've created my first Swift Package recently. It's only used in iOS currently, and if it goes anywhere else, it might be on tvOS, but that would be it.
I was having trouble getting UIKit to be used. And I saw this note over here, and that really helped solve my problem: https://stackoverflow.com/a/58684636/1435520
The command I used (and mentioned above) is this:
swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"
However, I'd really like to have unit tests. Running swift test...
with the same arguments mentioned for swift build
. But then that gives me a new error:
error: module 'XCTest' was created for incompatible target x86_64-apple-macos10.14
So, I guess I'm just wondering if it's possible to do this. Like, how could I create a Swift Package, that uses UIKit, and have it be testable?