SkillAgentSearch skills...

SwiftUIPlaygrounds

Alternative to Xcode previews.

Install / Use

/learn @johnno1962/SwiftUIPlaygrounds
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SwiftUIPlaygrounds!

A shell project you can use to iterate over SwiftUI interfaces using the HotReloading project. Instead of a "preview" the interface is run in a completely live app and a form of Swizzling used to update when source files are changed. This form of Swizzling requires the "Other Linker Flags" -Xlinker -interposable to be set for the project. This form of iteration can be made available to most projects by adding the HotReloading Swift package.

For this to work reliably you need to erase the type of each interface View struct you want to inject using the .eraseToAnyView() method as shown in ContentView.swift. This is provided by the code in the HotSwiftUI project and display refreshes are forced when you modify a source by observing the injectionObserver global variable in the View struct.

For more details about how this is performed, consult the README.md of the InjectionIII project.

Related Skills

View on GitHub
GitHub Stars10
CategoryDevelopment
Updated6mo ago
Forks0

Languages

Swift

Security Score

82/100

Audited on Sep 6, 2025

No findings