Clean up iOS class declaration (#2462)

* Begin abstraction over UIKit

* Clean up UIWindow override declaration

* Clean up UIApplication delegate declaration

* Clean up UIViewController override declaration

* Finalize objc -> objc2 rename
This commit is contained in:
Mads Marquart 2022-09-08 20:30:34 +02:00 committed by GitHub
parent da7bf8e29b
commit fb248eaadc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 250 additions and 249 deletions

View file

@ -7,7 +7,8 @@ use std::{
sync::mpsc::{self, Receiver, Sender},
};
use objc::runtime::Object;
use objc2::runtime::Object;
use objc2::{class, msg_send, ClassType};
use raw_window_handle::{RawDisplayHandle, UiKitDisplayHandle};
use crate::{
@ -91,7 +92,6 @@ impl<T: 'static> EventLoop<T> {
`EventLoopProxy` might be helpful"
);
SINGLETON_INIT = true;
view::create_delegate_class();
}
let (sender_to_clone, receiver) = mpsc::channel();
@ -128,11 +128,14 @@ impl<T: 'static> EventLoop<T> {
event_loop: self.window_target,
}));
// Ensure application delegate is initialized
view::WinitApplicationDelegate::class();
UIApplicationMain(
0,
ptr::null(),
nil,
NSStringRust::alloc(nil).init_str("AppDelegate"),
NSStringRust::alloc(nil).init_str("WinitApplicationDelegate"),
);
unreachable!()
}