iOS UIKit simulator ARM64 utilities for Compose Multiplatform UI framework providing testing, interoperability, and platform-specific implementations.
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Compose UI Util provides essential utilities for iOS UIKit Simulator on ARM64 architecture within the Compose Multiplatform ecosystem. This artifact enables comprehensive testing, interoperability, and platform-specific implementations for iOS applications built with Compose Multiplatform.
// Internal testing utilities (for framework development)
import androidx.compose.test.utils.UIKitInstrumentedTest
import androidx.compose.test.utils.AccessibilityTestNode
import androidx.compose.test.utils.runUIKitInstrumentedTestPlatform-specific imports for iOS:
import androidx.compose.test.utils.toCGPoint
import androidx.compose.test.utils.toDpOffset
import androidx.compose.test.utils.center
import androidx.compose.test.utils.MockAppDelegate
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds// Set up iOS UIKit testing environment
runUIKitInstrumentedTest {
// Set compose content
setContent {
Text("Hello, iOS!")
}
// Wait for UI to stabilize
waitForIdle()
// Perform touch interactions
tap(center)
// Verify accessibility tree
assertAccessibilityTree {
node {
label = "Hello, iOS!"
}
}
}The ui-util-uikitsimarm64 artifact provides several key components:
Comprehensive testing infrastructure for iOS UIKit applications with Compose integration. Provides touch simulation, accessibility validation, and UI synchronization.
internal fun runUIKitInstrumentedTest(testBlock: UIKitInstrumentedTest.() -> Unit)
internal class UIKitInstrumentedTest {
val density: Density
val screenSize: DpSize
val appDelegate: MockAppDelegate
val hostingViewController: UIViewController
fun setContent(
configure: ComposeUIViewControllerConfiguration.() -> Unit = {},
content: @Composable () -> Unit
)
fun setContentWithAccessibilityEnabled(content: @Composable () -> Unit)
fun waitForIdle(timeoutMillis: Long = 500)
fun waitUntil(
conditionDescription: String? = null,
timeoutMillis: Long = 5_000,
condition: () -> Boolean
)
fun delay(timeoutMillis: Long)
fun tearDown()
}Touch event simulation system for iOS devices, providing hardware-level touch event generation and drag gesture support.
fun UIKitInstrumentedTest.touchDown(position: DpOffset): UITouch
fun UIKitInstrumentedTest.tap(position: DpOffset): UITouch
fun UITouch.dragTo(location: DpOffset, duration: Duration = 0.5.seconds): UITouch
fun UITouch.dragBy(offset: DpOffset, duration: Duration = 0.5.seconds): UITouch
fun UITouch.dragBy(dx: Dp = 0.dp, dy: Dp = 0.dp, duration: Duration = 0.5.seconds): UITouch
fun UITouch.moveToLocationOnWindow(location: DpOffset)
fun UITouch.hold(): UITouch
fun UITouch.up(): UITouchiOS accessibility system integration with VoiceOver support and accessibility tree validation.
internal data class AccessibilityTestNode(
var isAccessibilityElement: Boolean? = null,
var identifier: String? = null,
var label: String? = null,
var value: String? = null,
var frame: DpRect? = null,
var children: List<AccessibilityTestNode>? = null,
var traits: List<UIAccessibilityTraits>? = null,
var element: NSObject? = null,
var parent: AccessibilityTestNode? = null
)
internal fun UIKitInstrumentedTest.getAccessibilityTree(): AccessibilityTestNode
internal fun UIKitInstrumentedTest.assertAccessibilityTree(expected: AccessibilityTestNode.() -> Unit)
internal fun UIKitInstrumentedTest.findNodeWithTag(tag: String): AccessibilityTestNode
internal fun UIKitInstrumentedTest.findNodeWithLabel(label: String): AccessibilityTestNode
internal fun AccessibilityTestNode.normalized(): AccessibilityTestNode?
fun AccessibilityTestNode.tap(): UITouch
fun AccessibilityTestNode.doubleTap(): UITouchConversion utilities between Compose coordinate systems and iOS Core Graphics coordinates.
internal fun DpOffset.toCGPoint(): CValue<CGPoint>
internal fun CValue<CGPoint>.toDpOffset(): DpOffset
internal fun DpRect.toRect(density: Density): Rect
internal fun Rect.toDpRect(density: Density): DpRect
internal fun DpRect.center(): DpOffset
internal fun DpRectZero(): DpRect
internal fun DpRect.intersect(other: DpRect): DpRect
internal fun CValue<CGRect>.toDpRect(): DpRect// Core testing types
internal class UIKitInstrumentedTest
internal data class AccessibilityTestNode
internal class MockAppDelegate : NSObject(), UIApplicationDelegateProtocol
// Touch and gesture types
interface UITouch {
val location: DpOffset
fun moveToLocationOnWindow(location: DpOffset)
fun hold(): UITouch
fun up(): UITouch
fun dragTo(location: DpOffset, duration: Duration = 0.5.seconds): UITouch
fun dragBy(offset: DpOffset, duration: Duration = 0.5.seconds): UITouch
fun dragBy(dx: Dp = 0.dp, dy: Dp = 0.dp, duration: Duration = 0.5.seconds): UITouch
}
// Coordinate system types
typealias DpOffset = androidx.compose.ui.unit.DpOffset
typealias DpRect = androidx.compose.ui.unit.DpRect
typealias DpSize = androidx.compose.ui.unit.DpSize
typealias Density = androidx.compose.ui.unit.Density
// Platform-specific types
typealias UIAccessibilityTraits = kotlin.ULong
typealias Duration = kotlin.time.Duration