alexandre mommers
09/13/2024, 4:51 PMFrançois
09/14/2024, 6:01 AMalexandre mommers
09/14/2024, 11:06 AMFrançois
09/14/2024, 11:57 AMalexandre mommers
09/14/2024, 12:05 PM@file:OptIn(ExperimentalForeignApi::class, BetaInteropApi::class, ExperimentalObjCName::class)
import kotlinx.cinterop.BetaInteropApi
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.autoreleasepool
import kotlinx.cinterop.memScoped
import kotlinx.cinterop.toCStringArray
import platform.Foundation.NSStringFromClass
import platform.UIKit.UIApplication
import platform.UIKit.UIApplicationDelegateProtocol
import platform.UIKit.UIApplicationDelegateProtocolMeta
import platform.UIKit.UIApplicationMain
import platform.UIKit.UIResponder
import platform.UIKit.UIResponderMeta
import platform.UIKit.UIScreen
import platform.UIKit.UIViewController
import platform.UIKit.UIWindow
import platform.darwin.dispatch_async
import platform.darwin.dispatch_get_main_queue
import kotlin.experimental.ExperimentalObjCName
fun main(args: Array<String>) {
println("Hello cube")
memScoped {
val argc = args.size + 1
val argv = (arrayOf("konan") + args).toCStringArray(memScope)
autoreleasepool {
println("Hello cube ${args.joinToString()}}")
UIApplicationMain(argc, argv, null, NSStringFromClass(AppDelegate))
}
}
}
class AppDelegate : UIResponder, UIApplicationDelegateProtocol {
companion object : UIResponderMeta(), UIApplicationDelegateProtocolMeta {}
private var _window: UIWindow? = null
@OverrideInit
constructor() : super()
override fun application(
application: UIApplication,
didFinishLaunchingWithOptions: Map<Any?, *>?
): Boolean {
println("Hello cube")
val window = UIWindow(frame = UIScreen.mainScreen.bounds)
setWindow(window)
return true
}
override fun window() = _window
override fun setWindow(window: UIWindow?) {
_window = window
}
}
But that crashing when running on simulator with no explicit error.
That why I looking to a project that work to understand what is wrong.
I'm rolling back to XCFramework with a few piece of swift code and a XCode project, but that a shame to not provide a full iOS experience directly with gradle.François
09/14/2024, 12:07 PMFrançois
09/14/2024, 12:12 PMalexandre mommers
09/14/2024, 12:13 PM