Compose Multiplatform runtime library for iOS UIKit x64 target providing core runtime functionality for declarative UI framework integration.
npx @tessl/cli install tessl/maven-org-jetbrains-compose-runtime--runtime-uikitx64@1.8.0Compose Runtime for iOS UIKit x64 provides the core runtime library for Compose Multiplatform targeting iOS UIKit x64 architecture (iOS simulator on Intel Macs). This runtime enables declarative UI development by providing state management, composition lifecycle, and platform integration capabilities for iOS applications.
build.gradle.kts:dependencies {
implementation("org.jetbrains.compose.runtime:runtime-uikitx64:1.8.2")
}import androidx.compose.runtime.*
import androidx.compose.runtime.snapshots.*import androidx.compose.runtime.*
@Composable
fun CounterApp() {
var count by remember { mutableStateOf(0) }
Column {
Text("Count: $count")
Button(onClick = { count++ }) {
Text("Increment")
}
}
}
// iOS Integration
fun MainViewController(): UIViewController = ComposeUIViewController {
CounterApp()
}Compose Runtime is built around several key components:
Core state management functionality providing reactive state holders and change detection. Essential for building dynamic UIs that respond to data changes.
fun <T> mutableStateOf(value: T): MutableState<T>
fun <T> derivedStateOf(calculation: () -> T): State<T>
interface State<out T> {
val value: T
}
interface MutableState<T> : State<T> {
override var value: T
}Composition management and lifecycle control for building and managing UI component trees. Handles component creation, updates, and disposal.
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE)
annotation class Composable
fun <T> remember(calculation: () -> T): T
fun <T> remember(key1: Any?, calculation: () -> T): TSide effect management with lifecycle-aware execution and automatic cleanup. Provides safe ways to perform operations outside the composition scope.
fun DisposableEffect(
key1: Any?,
effect: DisposableEffectScope.() -> DisposableEffectResult
): Unit
fun LaunchedEffect(
key1: Any?,
block: suspend CoroutineScope.() -> Unit
): Unit
fun SideEffect(effect: () -> Unit): UnitContext-like data flow mechanism for passing data implicitly down the composition tree without explicit parameter passing.
abstract class CompositionLocal<T>(defaultFactory: (() -> T)?)
abstract class ProvidableCompositionLocal<T> : CompositionLocal<T>
fun <T> compositionLocalOf(defaultFactory: (() -> T)? = null): ProvidableCompositionLocal<T>
fun <T> staticCompositionLocalOf(defaultFactory: (() -> T)? = null): ProvidableCompositionLocal<T>
@Composable
fun CompositionLocalProvider(
vararg values: ProvidedValue<*>,
content: @Composable () -> Unit
): UnitLow-level snapshot-based state management providing efficient change tracking and transactional state updates.
abstract class Snapshot {
companion object {
val global: MutableSnapshot
val current: Snapshot
fun takeSnapshot(readObserver: ((Any) -> Unit)? = null): Snapshot
fun takeMutableSnapshot(
readObserver: ((Any) -> Unit)? = null,
writeObserver: ((Any) -> Unit)? = null
): MutableSnapshot
}
}
fun <T> snapshotFlow(block: () -> T): Flow<T>Platform-specific integration for embedding Compose Multiplatform in iOS UIKit applications with seamless interoperability.
fun ComposeUIViewController(
content: @Composable () -> Unit
): UIViewController
fun ComposeUIViewController(
configure: UIViewController.() -> Unit = {},
content: @Composable () -> Unit
): UIViewController
@Composable
fun UIKitView(
factory: () -> UIView,
modifier: Modifier = Modifier,
update: (UIView) -> Unit = {}
)The runtime can throw the following exceptions:
ComposeUIViewController for embedding Compose in UIKit