Kotlin Multiplatform Development
 

Handling touch events with interop on iOS

Edit pageLast modified: 16 October 2024

On iOS, Compose Multiplatform can integrate with the native UIKit and SwiftUI frameworks. One challenge of such integration is handling touches: when a Compose Multiplatform app includes native UI elements, the app may need to react differently to touches in the interop area depending on the context.

Currently, Compose Multiplatform has only one strategy for dealing with touch events in a native view: all touches are processed entirely by the native UI, with Compose not being aware that they occurred at all.

Both the default behavior and the ability to customize it will be improved with the release of Compose Multiplatform 1.7.0. Changes are described in the following sections. Consider trying them out with the 1.7.3 version.