Thursday, September 29, 2022

[FIXED] How to add an additional platform to a SwiftUI project

Issue

I've started with a SwiftUI project for iOS. Now I'd like to add tvOS and watchOS as additional target platforms. Of course all platforms should share the same models, APIs and some views. Some views will be different for each platform.

How can I add subprojects to my existing structure?


Solution

It is not necessary to create new sub-projects, just create new target for desired platform in you current project and add shared files to new platform target, as on demo below

demo



Answered By - Asperi
Answer Checked By - Marilyn (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.