From de95f1cf217f6fdc03bbb9fcaea306a46c378fa6 Mon Sep 17 00:00:00 2001 From: Boris Yurkevich Date: Tue, 11 Jul 2017 15:35:57 +0100 Subject: [PATCH] Swift 3 update --- .../project.pbxproj | 3 +++ .../AppDelegate.swift | 20 +++++++++---------- .../SecondViewController.swift | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/LandscapeController_Swift/LandscapeController_Swift.xcodeproj/project.pbxproj b/LandscapeController_Swift/LandscapeController_Swift.xcodeproj/project.pbxproj index 7599245..e59cd9d 100644 --- a/LandscapeController_Swift/LandscapeController_Swift.xcodeproj/project.pbxproj +++ b/LandscapeController_Swift/LandscapeController_Swift.xcodeproj/project.pbxproj @@ -99,6 +99,7 @@ TargetAttributes = { B28BDDD41D1866E100F071FB = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0830; }; }; }; @@ -257,6 +258,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.olxios.landscape.LandscapeController-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -268,6 +270,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.olxios.landscape.LandscapeController-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/LandscapeController_Swift/LandscapeController_Swift/AppDelegate.swift b/LandscapeController_Swift/LandscapeController_Swift/AppDelegate.swift index d530e95..6885828 100644 --- a/LandscapeController_Swift/LandscapeController_Swift/AppDelegate.swift +++ b/LandscapeController_Swift/LandscapeController_Swift/AppDelegate.swift @@ -15,36 +15,36 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // MARK: Application State - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) {} + func applicationWillResignActive(_ application: UIApplication) {} - func applicationDidEnterBackground(application: UIApplication) {} + func applicationDidEnterBackground(_ application: UIApplication) {} - func applicationWillEnterForeground(application: UIApplication) {} + func applicationWillEnterForeground(_ application: UIApplication) {} - func applicationDidBecomeActive(application: UIApplication) {} + func applicationDidBecomeActive(_ application: UIApplication) {} - func applicationWillTerminate(application: UIApplication) {} + func applicationWillTerminate(_ application: UIApplication) {} // MARK: Orientation - func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask { + func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { if self.window?.rootViewController?.presentedViewController is SecondViewController { let secondController = self.window!.rootViewController!.presentedViewController as! SecondViewController if secondController.isPresented { - return UIInterfaceOrientationMask.All; + return UIInterfaceOrientationMask.all; } else { - return UIInterfaceOrientationMask.Portrait; + return UIInterfaceOrientationMask.portrait; } } else { - return UIInterfaceOrientationMask.Portrait; + return UIInterfaceOrientationMask.portrait; } } diff --git a/LandscapeController_Swift/LandscapeController_Swift/SecondViewController.swift b/LandscapeController_Swift/LandscapeController_Swift/SecondViewController.swift index 68fd8c3..3ab3763 100644 --- a/LandscapeController_Swift/LandscapeController_Swift/SecondViewController.swift +++ b/LandscapeController_Swift/LandscapeController_Swift/SecondViewController.swift @@ -16,7 +16,7 @@ class SecondViewController: UIViewController { func dismiss() { isPresented = false - self.presentingViewController!.dismissViewControllerAnimated(true, completion: nil); + self.presentingViewController!.dismiss(animated: true, completion: nil); } }