Skip to content

Releases

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 12:50
789252d

Changed (breaking)

  • systemImage and systemName parameters take an SFSymbol instead of a String. Constants are generated for
    every SF Symbol (SFSymbol.starFill, with availability in their KDoc); SFSymbol("name") covers custom or newer
    symbols. Migrate with systemImage = "star.fill" → systemImage = SFSymbol.starFill.
  • SwiftUIEnvironment exposes ColorScheme, DynamicTypeSize, UserInterfaceSizeClass and LayoutDirection
    instead of strings. An absent size class is now null (it used to be an empty string).

Added

  • Label and ContentUnavailableView overloads that take an asset-catalog image with a LocalizedKey title. They
    used to clash with the systemImage overloads.

Fixed

  • renderComposeSwiftUIPreviews links static frameworks that use C libraries, such as SQLDelight's SQLite driver.
    It passes the framework's linkerOpts to the preview host and strips dead code like Xcode does. If symbols are
    still missing, the error says to declare those libraries with linkerOpts.

Install with the Gradle plugin in your shared KMP module:

plugins {
    id("dev.nucleusframework.compose-swiftui") version "0.4.0"
}

Library: dev.nucleusframework:compose-swiftui:0.4.0 on Maven Central.
Gradle plugin: dev.nucleusframework.compose-swiftui 0.4.0 on the Gradle Plugin Portal.
IDE plugin (previews in IntelliJ IDEA / Android Studio): download the zip below, then
Settings › Plugins › ⚙ › Install Plugin from Disk.

Full Changelog: v0.3.2...v0.4.0

v0.3.2

Choose a tag to compare

@github-actions github-actions released this 15 Nov 12:28
d308596

Fixed

  • renderComposeSwiftUIPreviews works with the configuration cache in modules that use Compose Multiplatform
    resources. It used to fail with "cannot serialize object of type AssembleTargetResourcesTask".
  • The IntelliJ plugin asks for an IDE restart after it is installed. Without the restart, the previews stayed blank.

Install with the Gradle plugin in your shared KMP module:

plugins {
    id("dev.nucleusframework.compose-swiftui") version "0.3.2"
}

Library: dev.nucleusframework:compose-swiftui:0.3.2 on Maven Central.
Gradle plugin: dev.nucleusframework.compose-swiftui 0.3.2 on the Gradle Plugin Portal.
IDE plugin (previews in IntelliJ IDEA / Android Studio): download the zip below, then
Settings › Plugins › ⚙ › Install Plugin from Disk.

Full Changelog: v0.3.1...v0.3.2

v0.3.1

Choose a tag to compare

@kdroidFilter kdroidFilter released this 15 Nov 12:10
2c6d9a0

Added

  • IntelliJ IDEA / Android Studio plugin (intellij-plugin): Kotlin files with @Preview open in a code | preview split
    editor, with a gutter icon per preview. Previews are rendered with real SwiftUI on the iOS simulator by the new
    renderComposeSwiftUIPreviews Gradle task, and again on every save.

Fixed

  • TextEditorView(TextEditor(text:)) was read-only: bindings inside nested values were sent to SwiftUI as constants.
    They now update the text and call the Kotlin onTextChange callback.

Install with the Gradle plugin in your shared KMP module:

plugins {
    id("dev.nucleusframework.compose-swiftui") version "0.3.1"
}

Library: dev.nucleusframework:compose-swiftui:0.3.1 on Maven Central.
Gradle plugin: dev.nucleusframework.compose-swiftui 0.3.1 on the Gradle Plugin Portal.
IDE plugin (previews in IntelliJ IDEA / Android Studio): download the zip below, then
Settings › Plugins › ⚙ › Install Plugin from Disk.

What's Changed

New Contributors

Full Changelog: v0.3.0...v0.3.1

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 06:14
2374370

Added

  • @Preview for Compose SwiftUI composables, rendered in Xcode's canvas. The Gradle plugin finds top-level,
    parameterless @Preview @Composable functions (any annotation named Preview works) and writes
    ComposeSwiftUIPreviews.swift next to the renderer, with one Swift #Preview per function and a
    ComposeSwiftUIPreviewGallery view that lists them all. The task is generateComposeSwiftUIPreviews.
  • LazyForEach(items, key) { item -> } for long lists: inside a List or 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 @Observable models.
  • 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, and flushCompose() 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

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 15 Nov 04:30
740b2f4

Added

  • UIKitView, UIViewControllerView, AppKitView and NSViewControllerView take a sizing parameter.
    NativeViewSizing.FitHeight sizes the embedded view to its content at the proposed width, so a paragraph of variable
    length is neither cut nor followed by a gap. FitContent uses the content's size in both directions. Fill, the
    default, keeps the previous behavior.
  • The same four functions take an update callback that runs on every recomposition, to push Kotlin state into the
    embedded view.

Install with the Gradle plugin in your shared KMP module:

plugins {
    id("dev.nucleusframework.compose-swiftui") version "0.2.1"
}

Library: dev.nucleusframework:compose-swiftui:0.2.1 on Maven Central.
Gradle plugin: dev.nucleusframework.compose-swiftui 0.2.1 on the Gradle Plugin Portal.

Full Changelog: v0.2.0...v0.2.1

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 04:01
310cc63

Added

  • TabView(selection, onSelectionChange) and Tab(title, systemImage, value): the selected tab is Kotlin state, so
    code can switch tabs (for example a button in one tab that opens another). Tapping the tab bar calls
    onSelectionChange.
  • Mixed-style text: Text(StyledString), built with buildStyledString { withStyle(SpanStyle(...)) { append(...) } }
    like Compose's buildAnnotatedString. A SpanStyle sets color, font, font size, weight, design, italic, underline,
    strikethrough, monospaced, baseline offset and kerning. Nested styles merge. This replaces Text + Text and
    AttributedString, which Kotlin can't express.
  • The sample app shows both: a tab bar switched from Kotlin and a styled paragraph.

Install with the Gradle plugin in your shared KMP module:

plugins {
    id("dev.nucleusframework.compose-swiftui") version "0.2.0"
}

Library: dev.nucleusframework:compose-swiftui:0.2.0 on Maven Central.
Gradle plugin: dev.nucleusframework.compose-swiftui 0.2.0 on the Gradle Plugin Portal.

Full Changelog: v0.1.1...v0.2.0

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 15 Nov 03:24
251b6cc

Install with the Gradle plugin in your shared KMP module:

plugins {
    id("dev.nucleusframework.compose-swiftui") version "0.1.1"
}

Library: dev.nucleusframework:compose-swiftui:0.1.1 on Maven Central.
Gradle plugin: dev.nucleusframework.compose-swiftui 0.1.1 on the Gradle Plugin Portal.

Full Changelog: v0.1.0...v0.1.1

v0.1.0

Choose a tag to compare

@kdroidFilter kdroidFilter released this 15 Nov 03:23
90c48ce

First release of Compose SwiftUI: write SwiftUI screens in Kotlin with the Compose runtime, on iOS, macOS, tvOS and watchOS.

Install with the Gradle plugin in your shared KMP module (Kotlin 2.4.20+):

plugins {
    kotlin("multiplatform")
    id("dev.nucleusframework.compose-swiftui") version "0.1.0"
}

Then build once in Xcode, add the generated iosApp/ComposeSwiftUI folder to your app target, and show a screen with ComposeView { MyScreenKt.myScreen() }. The README has the full guide.

What's in 0.1.0:

  • Kotlin API generated from the SwiftUI SDK: 3,568 entries of Apple's SwiftUI documentation, each compiled for iOS, macOS, tvOS and watchOS.
  • Your androidx ViewModels, StateFlows and remember state work unchanged.
  • Hand-written APIs for navigation by path, item-driven sheets and alerts, environment values, focus, gestures, matched geometry, withAnimation, custom layouts and shapes, and embedded UIKit/AppKit views.
  • Benchmark of 50 screens against plain SwiftUI: updates 0.82x the time on iOS and 0.99x on macOS, mounts 1.06x and 1.14x; 48/50 screens pixel-identical on iOS, 50/50 on macOS.

Artifacts: dev.nucleusframework:compose-swiftui:0.1.0 on Maven Central, plugin dev.nucleusframework.compose-swiftui 0.1.0 on the Gradle Plugin Portal.