Hi, is it possible in iosMain to have: ```actual t...
# multiplatform
f
Hi, is it possible in iosMain to have:
Copy code
actual typealias Screen = View
(SwiftUI View). I can't import it, i see there is a UIView but it is not the same thing
l
SwiftUI View is a Swift struct, which cinterop doesn't support. Swift structs have copy mechanics that don't match well with any existing Kotlin constructs.
f
@Landry Norris i've also asked this to bard and it gave me this: import kotlin.native.objc.OCClass actual typealias Screen = objc.OCClass(SwiftUI.View) what do you think about this?
I mean i just want to have this typealias and i don't want to use any methods
l
LLMs like Bard aren't always reliable when it comes to generating code, especially for new and niche technologies (SwiftUI would be too new for there to be a lot of resources and Kotlin/Native has changed a lot since knowledge cutoffs). They also often hallucinate code when convenient.
f
it is just typealias for common where methods returns Screen (and they are implemented in each platform native code)
l
As of now, Kotlin doesn't interop with Swift structs, and likely won't without real value types (different from value class), which JVM doesn't support.
f
ok, so this is just impossible task
l
You'd likely be best off with UIKit and UIView.
f
Ok, thank you