Initial project
This commit is contained in:
29
apps/im_app/ios/Runner/SceneDelegate.swift
Normal file
29
apps/im_app/ios/Runner/SceneDelegate.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
|
||||
@objc class SceneDelegate: FlutterSceneDelegate {
|
||||
var flutterViewController: FlutterViewController?
|
||||
|
||||
override func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
guard let windowScene = scene as? UIWindowScene else { return }
|
||||
|
||||
window = UIWindow(windowScene: windowScene)
|
||||
|
||||
let flutterVC = FlutterViewController()
|
||||
flutterViewController = flutterVC
|
||||
|
||||
window?.rootViewController = flutterVC
|
||||
window?.makeKeyAndVisible()
|
||||
|
||||
registerSceneLifeCycle(with: flutterVC.engine)
|
||||
|
||||
super.scene(scene, willConnectTo: session, options: connectionOptions)
|
||||
}
|
||||
|
||||
override func sceneDidDisconnect(_ scene: UIScene) {
|
||||
if let flutterVC = flutterViewController {
|
||||
self.unregisterSceneLifeCycle(with: flutterVC.engine)
|
||||
}
|
||||
super.sceneDidDisconnect(scene)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user