You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.2 KiB
34 lines
1.2 KiB
import Flutter
|
|
import UIKit
|
|
|
|
@main
|
|
@objc class AppDelegate: FlutterAppDelegate {
|
|
override func application(
|
|
_ application: UIApplication,
|
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
|
) -> Bool {
|
|
|
|
///InitCocosIntegrationWithOptions(argc: CommandLine.argc, argv: CommandLine.unsafeArgv, launchOptions)
|
|
|
|
|
|
let flutterEngine = FlutterEngine(name: "io.flutter", project: nil)
|
|
flutterEngine.run()
|
|
let controller = FlutterViewControllerWithTransition(engine: flutterEngine, nibName: nil, bundle: nil)
|
|
self.window = UIWindow(frame: UIScreen.main.bounds)
|
|
self.window?.rootViewController = controller
|
|
self.window?.makeKeyAndVisible()
|
|
GeneratedPluginRegistrant.register(with: self)
|
|
|
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
|
}
|
|
|
|
|
|
}
|
|
class FlutterViewControllerWithTransition: FlutterViewController {
|
|
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
|
super.viewWillTransition(to: size, with: coordinator)
|
|
|
|
NotificationCenter.default.post(name: NSNotification.Name("ViewWillTransition"), object: nil, userInfo: ["size": size, "coordinator": coordinator])
|
|
|
|
}
|
|
} |