diff --git a/Chameleon.xcodeproj/project.pbxproj b/Chameleon.xcodeproj/project.pbxproj index 271dce6..4d7b377 100755 --- a/Chameleon.xcodeproj/project.pbxproj +++ b/Chameleon.xcodeproj/project.pbxproj @@ -660,6 +660,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -709,6 +710,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -734,7 +736,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -755,7 +757,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.viccalexander.Chameleon; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -780,7 +782,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.viccalexander.ChameleonDemo-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -805,7 +807,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.viccalexander.ChameleonDemo-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -819,7 +821,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.viccalexander.ChameleonDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -832,7 +834,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.viccalexander.ChameleonDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/ChameleonDemo-Swift/FirstViewController.swift b/ChameleonDemo-Swift/FirstViewController.swift index 01ef1aa..e573428 100644 --- a/ChameleonDemo-Swift/FirstViewController.swift +++ b/ChameleonDemo-Swift/FirstViewController.swift @@ -59,7 +59,7 @@ class FirstViewController: UITableViewController { let randomFlatColorContract = ContrastColorOf(randomFlatColor, returnFlat: true) // Nav bar navigationController?.navigationBar.barTintColor = randomFlatColor - navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: randomFlatColorContract] + navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor.rawValue: randomFlatColorContract] // Tab bar tabBarController?.tabBar.barTintColor = randomFlatColor tabBarController?.tabBar.tintColor = randomFlatColorContract diff --git a/ChameleonDemo-Swift/SecondViewController.swift b/ChameleonDemo-Swift/SecondViewController.swift index a0f1246..e786c26 100644 --- a/ChameleonDemo-Swift/SecondViewController.swift +++ b/ChameleonDemo-Swift/SecondViewController.swift @@ -42,7 +42,7 @@ class SecondViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() - navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: tabBarController?.tabBar.tintColor ?? UIColor.gray] + navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor.rawValue: tabBarController?.tabBar.tintColor ?? UIColor.gray] navigationController?.navigationBar.barTintColor = tabBarController?.tabBar.barTintColor ?? UIColor.lightGray sampleOneImageView.image = #imageLiteral(resourceName: "SampleImageOne") sampleTwoImageView.image = #imageLiteral(resourceName: "SampleImageTwo") @@ -54,7 +54,7 @@ class SecondViewController: UITableViewController { } override func viewWillAppear(_ animated: Bool) { - navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: tabBarController?.tabBar.tintColor ?? UIColor.gray] + navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor.rawValue: tabBarController?.tabBar.tintColor ?? UIColor.gray] navigationController?.navigationBar.barTintColor = tabBarController?.tabBar.barTintColor ?? UIColor.lightGray }