marinofaggiana 4 年之前
父节点
当前提交
0755e0fee8
共有 2 个文件被更改,包括 12 次插入11 次删除
  1. 3 3
      iOSClient/Login/CCLogin.m
  2. 9 8
      iOSClient/Login/NCLoginWeb.swift

+ 3 - 3
iOSClient/Login/CCLogin.m

@@ -407,10 +407,10 @@
         } else {
             [CCUtility setIntro:YES];
             if (self.presentingViewController == nil) {
-                UISplitViewController *splitController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateInitialViewController];
-                splitController.modalPresentationStyle = UIModalPresentationFullScreen;
+                UIViewController *viewController = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateInitialViewController];
+                viewController.modalPresentationStyle = UIModalPresentationFullScreen;
                 [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_initializeMain object:nil userInfo:nil];
-                appDelegate.window.rootViewController = splitController;
+                appDelegate.window.rootViewController = viewController;
                 [appDelegate.window makeKeyWindow];
             } else {
                 [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_initializeMain object:nil userInfo:nil];

+ 9 - 8
iOSClient/Login/NCLoginWeb.swift

@@ -241,14 +241,15 @@ extension NCLoginWeb: WKNavigationDelegate {
             
             CCUtility.setIntro(true)
             if (self.presentingViewController == nil) {
-                let splitController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
-                splitController?.modalPresentationStyle = .fullScreen
-                NotificationCenter.default.postOnMainThread(name: k_notificationCenter_initializeMain)
-                splitController!.view.alpha = 0
-                appDelegate.window.rootViewController = splitController!
-                appDelegate.window.makeKeyAndVisible()
-                UIView.animate(withDuration: 0.5) {
-                    splitController!.view.alpha = 1
+                if let viewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() {
+                    viewController.modalPresentationStyle = .fullScreen
+                    NotificationCenter.default.postOnMainThread(name: k_notificationCenter_initializeMain)
+                    viewController.view.alpha = 0
+                    appDelegate.window.rootViewController = viewController
+                    appDelegate.window.makeKeyAndVisible()
+                    UIView.animate(withDuration: 0.5) {
+                        viewController.view.alpha = 1
+                    }
                 }
             } else {
                 NotificationCenter.default.postOnMainThread(name: k_notificationCenter_initializeMain)