2

I have some SwiftUI code that I put inside a Swift Package. Since you can't run SwiftUI code from a Swift Package directly as this question suggests I loaded the Swift Package as an editable local dependency on a real test xCode project.

I can get the SwiftUI code from the Swift Package to execute.

However, the live refresh does not work like it should. To get the "Live Preview" to render the SwiftUI code from the Swift Package I have to Clean (shift + command + K) -> Build (shift + command + K) -> Refresh (option + command + P) every-time.

Any thoughts on how I can get "Live Preview" to work with this setup?

4
  • Does this answer your question? Run SwiftUI preview from SPM Package Commented Apr 1, 2020 at 17:17
  • No, that question does not adequately describe my specific problem. Also, that question is phrased around running just a Swift Package. I'm running an actual xCode project with the Swift Package loaded as an editable dependency. Commented Apr 1, 2020 at 19:59
  • I edited the question to illustrate the differences between questions. Commented Apr 1, 2020 at 20:05
  • I am encountering the same issue, any solution? Commented Oct 11, 2022 at 18:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.