:apple: Embedding SwiftUI view inside Compose I‘...
# compose-ios
m
🍎 Embedding SwiftUI view inside Compose I‘m trying to find documentation on how Swift-Compose interop works under the hood. Does anyone have a useful link? Specifically i‘d like to know: • do swift interop views live on top of the Compose skia canvas, or the canvas has a cutout where it‘s transparent and the swift view is below • what performance tradeoffs are to be expected and why • can the swift ui view exceeds it‘s bounds? (e.g. with the new liquid glass design, it looks to me like a view grows when touched and the liquid effect starts)
1
2
a
• do swift interop views live on top of the Compose skia canvas, or the canvas has a cutout where it‘s transparent and the swift view is below
We're making holes in Compose canvas and place interop views below the canvas.
• what performance tradeoffs are to be expected and why
No hidden performance degradation. It works quite close to what we have in native apps.
• can the swift ui view exceeds it‘s bounds? (e.g. with the new liquid glass design, it looks to me like a view grows when touched and the liquid effect starts)
No, the "hole" sizes for interop views are pre-defined in Compose, so it's impossible to make it bigger automatically. For now we would recommend either to place controls that support liquid glass on top of the ComposeUIViewController, or use libraries that mimic liquid glass components.
1
m
Thx @Andrei Salavei for the explanation and answering all of my questions! Appreciate it
🫠 1