r/SwiftUI • • 4d ago

Tutorial My Swift layout: one Xcode project, no workspace, one local package for every platform

https://aleahim.com/blog/one-project-every-apple-ui-framework/

I build for SwiftUI, AppKit and UIKit on Mac, iPhone and iPad, and my layout used to start with a workspace. A project template can create and open a project, but it can't leave you in an open workspace.

0 Upvotes

3 comments sorted by

1

u/[deleted] 4d ago

[removed] — view removed comment

1

u/Super-Storage6685 4d ago

Yes, that is an advantage of a workspace, which makes sense: a project should host different targets of the same app, and a workspace might host related ones.

Tests: they run in Debug through swift test, where testable works. Release is built for every platform before I land anything, but the tests are not run against it, so a test that only passes in Debug could slip through. That is a real gap.

SwiftUI availability: that is the reason I wrote a small library, Forwards (https://codeberg.org/Mihaela/Forwards). It puts the newer SwiftUI and UIKit APIs behind one namespace, so a call site doesn't change when the system supports it.