Преглед на файлове

Add < iOS 13 support to example project

Tanner Bennett преди 6 години
родител
ревизия
83486641aa
променени са 3 файла, в които са добавени 16 реда и са изтрити 3 реда
  1. 2 2
      Example/FLEXample.xcodeproj/project.pbxproj
  2. 13 0
      Example/FLEXample/AppDelegate.swift
  3. 1 1
      Example/FLEXample/SceneDelegate.swift

+ 2 - 2
Example/FLEXample.xcodeproj/project.pbxproj

@@ -426,7 +426,7 @@
 				DEVELOPMENT_TEAM = S6N2F22V2Z;
 				ENABLE_PREVIEWS = YES;
 				INFOPLIST_FILE = "FLEXample/Supporting Files/Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
@@ -451,7 +451,7 @@
 				DEVELOPMENT_TEAM = S6N2F22V2Z;
 				ENABLE_PREVIEWS = YES;
 				INFOPLIST_FILE = "FLEXample/Supporting Files/Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",

+ 13 - 0
Example/FLEXample/AppDelegate.swift

@@ -11,6 +11,7 @@ import UIKit
 @UIApplicationMain @objcMembers
 class AppDelegate: UIResponder, UIApplicationDelegate {
     var repeatingLogExampleTimer: Timer!
+    var window: UIWindow?
 
     func application(_ application: UIApplication,
         didFinishLaunchingWithOptions options: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
@@ -29,9 +30,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         // To show off the network logger, send several misc network requests
         MiscNetworkRequests.sendExampleRequests()
         
+        // For < iOS 13, set up the window here
+        if ProcessInfo.processInfo.operatingSystemVersion.majorVersion < 13 {
+            let window = UIWindow(frame: UIScreen.main.bounds)
+            window.rootViewController = FLEXNavigationController(
+                rootViewController: CommitListViewController()
+            )
+            self.window = window
+            window.makeKeyAndVisible()
+            FLEXManager.shared.showExplorer()
+        }
+        
         return true
     }
 
+    @available(iOS 13.0, *)
     func application(_ application: UIApplication,
                      configurationForConnecting session: UISceneSession,
                      options: UIScene.ConnectionOptions) -> UISceneConfiguration {

+ 1 - 1
Example/FLEXample/SceneDelegate.swift

@@ -9,7 +9,7 @@
 import UIKit
 import SwiftUI
 
-@objcMembers
+@objcMembers @available(iOS 13.0, *)
 class SceneDelegate: UIResponder, UIWindowSceneDelegate {
 
     var window: UIWindow?