Why SwiftUI in static framework can't show preview ?
Asked on 08/07/2024
1 search
The reason SwiftUI in a static framework can't show previews is due to the architecture of Xcode Previews. This year, Xcode Previews has introduced a new dynamic linking architecture that uses the same build artifacts for both previews and when you build and run your project. This avoids the need to rebuild your project when switching between the two, making the workflow smoother and more productive. However, static frameworks do not support this dynamic linking architecture, which is why previews are not available in that context.
For more details, you can refer to the Platforms State of the Union (37:45) session.

Platforms State of the Union
Discover the newest advancements on Apple platforms.

What’s new in SwiftUI
Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.

Platforms State of the Union 5-Minute Recap
Watch a quick recap of the newest advancements on Apple platforms.