CodeScanner icon indicating copy to clipboard operation
CodeScanner copied to clipboard

Support Xcode preview for multi-platform project

Open naan opened this issue 9 months ago • 0 comments

There's a bug in Xcode Preview when you have a multi-platform project. When you set build destination other than iOS on preview in such project, Xcode Preview tries to build depended packages that does not support those platforms even you set not build those packages in Xcode. (more detail about this bug, please read: https://stackoverflow.com/questions/71334194/swiftui-preview-incorrectly-tries-to-build-conditional-dependency-from-another-p and https://forums.swift.org/t/swiftpm-platform-conditional-target-dependancy-not-resolved-for-tvos/56767)

This PR adds #if os(iOS) ~ #endif to the source files so it passes build on mac target.

naan avatar Apr 30 '24 13:04 naan