diff --git a/library/modules/platform/uikit.sx b/library/modules/platform/uikit.sx index d17b179..22180b7 100644 --- a/library/modules/platform/uikit.sx +++ b/library/modules/platform/uikit.sx @@ -186,7 +186,12 @@ SxAppDelegate :: #objc_class("SxAppDelegate") { #extends UIResponder; application_didFinishLaunchingWithOptions :: (self: *Self, app: *void, opts: *void) -> BOOL { - return xx uikit_did_finish_launching(xx self, xx 0, app, opts); + inline if OS == .ios { + if g_uikit_plat != null { + uikit_subscribe_keyboard_notifications(xx self); + } + } + return 1; } sxKeyboardWillChangeFrame :: (self: *Self, notification: *void) { @@ -213,11 +218,13 @@ SxSceneDelegate :: #objc_class("SxSceneDelegate") { } window :: (self: *Self) -> *void { - return uikit_window_getter(xx self, xx 0); + if g_uikit_plat == null { return xx 0; } + return g_uikit_plat.window; } setWindow :: (self: *Self, w: *void) { - uikit_window_setter(xx self, xx 0, w); + if g_uikit_plat == null { return; } + g_uikit_plat.window = w; } } @@ -560,25 +567,6 @@ uikit_create_gl_context :: (plat: *UIKitPlatform) { load_gl(@ios_gl_proc); } -uikit_window_getter :: (self: *void, _cmd: *void) -> *void callconv(.c) { - if g_uikit_plat == null { return xx 0; } - g_uikit_plat.window; -} - -uikit_window_setter :: (self: *void, _cmd: *void, w: *void) callconv(.c) { - if g_uikit_plat == null { return; } - g_uikit_plat.window = w; -} - -uikit_did_finish_launching :: (self: *void, _cmd: *void, app: *void, opts: *void) -> u8 callconv(.c) { - inline if OS == .ios { - if g_uikit_plat != null { - uikit_subscribe_keyboard_notifications(self); - } - } - 1; -} - uikit_subscribe_keyboard_notifications :: (delegate: *void) { inline if OS != .ios { return; } center := NSNotificationCenter.defaultCenter();