Repository navigation
v0.3.0
Added
@Previewfor Compose SwiftUI composables, rendered in Xcode's canvas. The Gradle plugin finds top-level,
parameterless@Preview @Composablefunctions (any annotation namedPreviewworks) and writes
ComposeSwiftUIPreviews.swiftnext to the renderer, with one Swift#Previewper function and a
ComposeSwiftUIPreviewGalleryview that lists them all. The task isgenerateComposeSwiftUIPreviews.LazyForEach(items, key) { item -> }for long lists: inside aListor a lazy stack, a row is composed only while
SwiftUI shows it, and disposed when it scrolls away. A 10,000-row list now mounts in 28 ms instead of 909 ms on the
iOS simulator, and a one-row change takes 0.4 ms instead of 4.5 ms.- A scenario benchmark (
scripts/run_scenarios.sh): long lists (mount, scrolling, one-row change, every row changed)
and animations, compared with plain SwiftUI using native@Observablemodels. - The sample app has two previews, a 5,000-row list and opens the preview gallery from its home screen.
Changed
- Generated containers render their content through
ChildrenView, andflushCompose()runs up to four passes so that
state written by effects is shown in the same SwiftUI update.
Install with the Gradle plugin in your shared KMP module:
plugins {
id("dev.nucleusframework.compose-swiftui") version "0.3.0"
}Library: dev.nucleusframework:compose-swiftui:0.3.0 on Maven Central.
Gradle plugin: dev.nucleusframework.compose-swiftui 0.3.0 on the Gradle Plugin Portal.
Full Changelog: v0.2.1...v0.3.0