Nikita Lipsky
2 years ago
committed by
GitHub
6 changed files with 24 additions and 111 deletions
@ -1,37 +1,8 @@
|
||||
import androidx.compose.ui.window.Application |
||||
import kotlinx.cinterop.* |
||||
import platform.UIKit.* |
||||
import platform.Foundation.* |
||||
import androidx.compose.ui.main.defaultUIKitMain |
||||
|
||||
fun main() { |
||||
val args = emptyArray<String>() |
||||
memScoped { |
||||
val argc = args.size + 1 |
||||
val argv = (arrayOf("skikoApp") + args).map { it.cstr.ptr }.toCValues() |
||||
autoreleasepool { |
||||
UIApplicationMain(argc, argv, null, NSStringFromClass(SkikoAppDelegate)) |
||||
} |
||||
} |
||||
} |
||||
|
||||
class SkikoAppDelegate : UIResponder, UIApplicationDelegateProtocol { |
||||
companion object : UIResponderMeta(), UIApplicationDelegateProtocolMeta |
||||
|
||||
@ObjCObjectBase.OverrideInit |
||||
constructor() : super() |
||||
|
||||
private var _window: UIWindow? = null |
||||
override fun window() = _window |
||||
override fun setWindow(window: UIWindow?) { |
||||
_window = window |
||||
} |
||||
|
||||
override fun application(application: UIApplication, didFinishLaunchingWithOptions: Map<Any?, *>?): Boolean { |
||||
window = UIWindow(frame = UIScreen.mainScreen.bounds) |
||||
window!!.rootViewController = Application("Chat") { |
||||
defaultUIKitMain("Chat", Application("Chat") { |
||||
ChatApp() |
||||
} |
||||
window!!.makeKeyAndVisible() |
||||
return true |
||||
} |
||||
}) |
||||
} |
||||
|
Loading…
Reference in new issue