From 1fb3a035935ffb0368fd2fae8164aa3069c171de Mon Sep 17 00:00:00 2001 From: AFathi Date: Thu, 20 Sep 2018 12:08:58 -0400 Subject: [PATCH] Swift project update to 4.2 --- Examples/Swift/ARVideoKit-Example.xcodeproj/project.pbxproj | 4 ++-- Examples/Swift/ARVideoKit-Example/AppDelegate.swift | 3 +-- .../View Controllers/SCNViewController.swift | 6 +++--- .../View Controllers/SKViewController.swift | 6 +++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Examples/Swift/ARVideoKit-Example.xcodeproj/project.pbxproj b/Examples/Swift/ARVideoKit-Example.xcodeproj/project.pbxproj index 492fd5c..6496c23 100644 --- a/Examples/Swift/ARVideoKit-Example.xcodeproj/project.pbxproj +++ b/Examples/Swift/ARVideoKit-Example.xcodeproj/project.pbxproj @@ -429,7 +429,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.ahmedbekhit.ARVideoKit-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -451,7 +451,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.ahmedbekhit.ARVideoKit-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Examples/Swift/ARVideoKit-Example/AppDelegate.swift b/Examples/Swift/ARVideoKit-Example/AppDelegate.swift index 69c4aa1..7de740e 100644 --- a/Examples/Swift/ARVideoKit-Example/AppDelegate.swift +++ b/Examples/Swift/ARVideoKit-Example/AppDelegate.swift @@ -19,8 +19,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return ViewAR.orientation } - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { return true } diff --git a/Examples/Swift/ARVideoKit-Example/View Controllers/SCNViewController.swift b/Examples/Swift/ARVideoKit-Example/View Controllers/SCNViewController.swift index 3bd134e..d4c4dc1 100644 --- a/Examples/Swift/ARVideoKit-Example/View Controllers/SCNViewController.swift +++ b/Examples/Swift/ARVideoKit-Example/View Controllers/SCNViewController.swift @@ -115,7 +115,7 @@ class SCNViewController: UIViewController, ARSCNViewDelegate, RenderARDelegate, }else if status == .denied || status == .restricted || status == .notDetermined { let errorView = UIAlertController(title: "😅", message: "Please allow access to the photo library in order to save this media file.", preferredStyle: .alert) let settingsBtn = UIAlertAction(title: "Open Settings", style: .cancel) { (_) -> Void in - guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else { + guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { return } if UIApplication.shared.canOpenURL(settingsUrl) { @@ -123,11 +123,11 @@ class SCNViewController: UIViewController, ARSCNViewDelegate, RenderARDelegate, UIApplication.shared.open(settingsUrl, completionHandler: { (success) in }) } else { - UIApplication.shared.openURL(URL(string:UIApplicationOpenSettingsURLString)!) + UIApplication.shared.openURL(URL(string:UIApplication.openSettingsURLString)!) } } } - errorView.addAction(UIAlertAction(title: "Later", style: UIAlertActionStyle.default, handler: { + errorView.addAction(UIAlertAction(title: "Later", style: UIAlertAction.Style.default, handler: { (UIAlertAction)in })) errorView.addAction(settingsBtn) diff --git a/Examples/Swift/ARVideoKit-Example/View Controllers/SKViewController.swift b/Examples/Swift/ARVideoKit-Example/View Controllers/SKViewController.swift index 2911cd3..4fa3b40 100644 --- a/Examples/Swift/ARVideoKit-Example/View Controllers/SKViewController.swift +++ b/Examples/Swift/ARVideoKit-Example/View Controllers/SKViewController.swift @@ -106,7 +106,7 @@ class SKViewController: UIViewController, ARSKViewDelegate, RenderARDelegate, Re }else if status == .denied || status == .restricted || status == .notDetermined { let errorView = UIAlertController(title: "😅", message: "Please allow access to the photo library in order to save this media file.", preferredStyle: .alert) let settingsBtn = UIAlertAction(title: "Open Settings", style: .cancel) { (_) -> Void in - guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else { + guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { return } if UIApplication.shared.canOpenURL(settingsUrl) { @@ -114,11 +114,11 @@ class SKViewController: UIViewController, ARSKViewDelegate, RenderARDelegate, Re UIApplication.shared.open(settingsUrl, completionHandler: { (success) in }) } else { - UIApplication.shared.openURL(URL(string:UIApplicationOpenSettingsURLString)!) + UIApplication.shared.openURL(URL(string:UIApplication.openSettingsURLString)!) } } } - errorView.addAction(UIAlertAction(title: "Later", style: UIAlertActionStyle.default, handler: { + errorView.addAction(UIAlertAction(title: "Later", style: UIAlertAction.Style.default, handler: { (UIAlertAction)in })) errorView.addAction(settingsBtn)