From d9bf7778da9ec35592509fa2e016ee2b5abd8f5e Mon Sep 17 00:00:00 2001 From: Ali Date: Wed, 17 Apr 2019 16:27:57 +0200 Subject: [PATCH] making the project works on Xcode 10.2 with Swift 5.0 --- Chameleon.xcodeproj/project.pbxproj | 24 ++++++++++++------ .../xcshareddata/xcschemes/Chameleon.xcscheme | 4 +-- ChameleonDemo-Swift/AppDelegate.swift | 3 +-- .../AppIcon.appiconset/Contents.json | 0 .../AppIcon.appiconset/Demo-1.png | Bin .../Assets.xcassets/Contents.json | 0 .../SampleImageOne.imageset/Contents.json | 0 .../SampleImageOne-1.png | Bin .../SampleImageTwo.imageset/Contents.json | 0 .../SampleImageTwo-1.png | Bin .../first.imageset/Contents.json | 0 .../Assets.xcassets/first.imageset/first.pdf | Bin .../logo.imageset/Contents.json | 0 .../Assets.xcassets/logo.imageset/logo@2x.png | Bin .../second.imageset/Contents.json | 0 .../second.imageset/second.pdf | Bin .../Base.lproj/LaunchScreen.storyboard | 0 .../Base.lproj/Main.storyboard | 0 ChameleonDemo-Swift/FirstViewController.swift | 4 +-- ChameleonDemo-Swift/Info.plist | 0 .../SecondViewController.swift | 4 +-- ChameleonDemo/AppDelegate.swift | 2 +- Extras/Chameleon.clr | Bin Extras/Chameleon.sketchpalette | 0 Extras/Chameleon_Photoshop.aco | Bin Extras/Chameleon_v2.clr | Bin Pod/Classes/Objective-C/UIColor+Chameleon.m | 2 ++ README.md | 0 28 files changed, 25 insertions(+), 18 deletions(-) mode change 100644 => 100755 ChameleonDemo-Swift/AppDelegate.swift mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/AppIcon.appiconset/Contents.json mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/AppIcon.appiconset/Demo-1.png mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/Contents.json mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/SampleImageOne.imageset/Contents.json mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/SampleImageOne.imageset/SampleImageOne-1.png mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/SampleImageTwo.imageset/Contents.json mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/SampleImageTwo.imageset/SampleImageTwo-1.png mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/first.imageset/Contents.json mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/first.imageset/first.pdf mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/logo.imageset/Contents.json mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/logo.imageset/logo@2x.png mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/second.imageset/Contents.json mode change 100644 => 100755 ChameleonDemo-Swift/Assets.xcassets/second.imageset/second.pdf mode change 100644 => 100755 ChameleonDemo-Swift/Base.lproj/LaunchScreen.storyboard mode change 100644 => 100755 ChameleonDemo-Swift/Base.lproj/Main.storyboard mode change 100644 => 100755 ChameleonDemo-Swift/FirstViewController.swift mode change 100644 => 100755 ChameleonDemo-Swift/Info.plist mode change 100644 => 100755 ChameleonDemo-Swift/SecondViewController.swift mode change 100644 => 100755 Extras/Chameleon.clr mode change 100644 => 100755 Extras/Chameleon.sketchpalette mode change 100644 => 100755 Extras/Chameleon_Photoshop.aco mode change 100644 => 100755 Extras/Chameleon_v2.clr mode change 100644 => 100755 README.md diff --git a/Chameleon.xcodeproj/project.pbxproj b/Chameleon.xcodeproj/project.pbxproj index 271dce6..dc6dd5d 100755 --- a/Chameleon.xcodeproj/project.pbxproj +++ b/Chameleon.xcodeproj/project.pbxproj @@ -390,7 +390,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0900; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Vicc Alexander"; TargetAttributes = { 0C8DABB01C07B5EA00B28FE2 = { @@ -411,7 +411,7 @@ }; buildConfigurationList = 240093F21BB4517400932727 /* Build configuration list for PBXProject "Chameleon" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -614,6 +614,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -622,12 +623,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -660,6 +663,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -670,6 +674,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -678,12 +683,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -709,6 +716,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -734,7 +742,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -755,7 +763,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.viccalexander.Chameleon; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -780,7 +788,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.viccalexander.ChameleonDemo-Swift"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -805,7 +813,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 = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -819,7 +827,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 = 5.0; }; name = Debug; }; @@ -832,7 +840,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 = 5.0; }; name = Release; }; diff --git a/Chameleon.xcodeproj/xcshareddata/xcschemes/Chameleon.xcscheme b/Chameleon.xcodeproj/xcshareddata/xcschemes/Chameleon.xcscheme index a813637..9ed3510 100755 --- a/Chameleon.xcodeproj/xcshareddata/xcschemes/Chameleon.xcscheme +++ b/Chameleon.xcodeproj/xcshareddata/xcschemes/Chameleon.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/ChameleonDemo-Swift/AppDelegate.swift b/ChameleonDemo-Swift/AppDelegate.swift old mode 100644 new mode 100755 index 6c8e9c5..fc5c23f --- a/ChameleonDemo-Swift/AppDelegate.swift +++ b/ChameleonDemo-Swift/AppDelegate.swift @@ -14,10 +14,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { return true } - } diff --git a/ChameleonDemo-Swift/Assets.xcassets/AppIcon.appiconset/Contents.json b/ChameleonDemo-Swift/Assets.xcassets/AppIcon.appiconset/Contents.json old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/AppIcon.appiconset/Demo-1.png b/ChameleonDemo-Swift/Assets.xcassets/AppIcon.appiconset/Demo-1.png old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/Contents.json b/ChameleonDemo-Swift/Assets.xcassets/Contents.json old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/SampleImageOne.imageset/Contents.json b/ChameleonDemo-Swift/Assets.xcassets/SampleImageOne.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/SampleImageOne.imageset/SampleImageOne-1.png b/ChameleonDemo-Swift/Assets.xcassets/SampleImageOne.imageset/SampleImageOne-1.png old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/SampleImageTwo.imageset/Contents.json b/ChameleonDemo-Swift/Assets.xcassets/SampleImageTwo.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/SampleImageTwo.imageset/SampleImageTwo-1.png b/ChameleonDemo-Swift/Assets.xcassets/SampleImageTwo.imageset/SampleImageTwo-1.png old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/first.imageset/Contents.json b/ChameleonDemo-Swift/Assets.xcassets/first.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/first.imageset/first.pdf b/ChameleonDemo-Swift/Assets.xcassets/first.imageset/first.pdf old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/logo.imageset/Contents.json b/ChameleonDemo-Swift/Assets.xcassets/logo.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/logo.imageset/logo@2x.png b/ChameleonDemo-Swift/Assets.xcassets/logo.imageset/logo@2x.png old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/second.imageset/Contents.json b/ChameleonDemo-Swift/Assets.xcassets/second.imageset/Contents.json old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Assets.xcassets/second.imageset/second.pdf b/ChameleonDemo-Swift/Assets.xcassets/second.imageset/second.pdf old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Base.lproj/LaunchScreen.storyboard b/ChameleonDemo-Swift/Base.lproj/LaunchScreen.storyboard old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/Base.lproj/Main.storyboard b/ChameleonDemo-Swift/Base.lproj/Main.storyboard old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/FirstViewController.swift b/ChameleonDemo-Swift/FirstViewController.swift old mode 100644 new mode 100755 index 01ef1aa..026d7ff --- 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 = [NSAttributedString.Key.foregroundColor: randomFlatColorContract] // Tab bar tabBarController?.tabBar.barTintColor = randomFlatColor tabBarController?.tabBar.tintColor = randomFlatColorContract @@ -119,7 +119,7 @@ class FirstViewController: UITableViewController { let green = Float(arc4random_uniform(256))/255.0 let blue = Float(arc4random_uniform(256))/255.0 - return UIColor(colorLiteralRed: red, green: green, blue: blue, alpha: 1.0) + return UIColor(_colorLiteralRed: red, green: green, blue: blue, alpha: 1.0) } } diff --git a/ChameleonDemo-Swift/Info.plist b/ChameleonDemo-Swift/Info.plist old mode 100644 new mode 100755 diff --git a/ChameleonDemo-Swift/SecondViewController.swift b/ChameleonDemo-Swift/SecondViewController.swift old mode 100644 new mode 100755 index a0f1246..565679b --- 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 = [NSAttributedString.Key.foregroundColor: 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 = [NSAttributedString.Key.foregroundColor: tabBarController?.tabBar.tintColor ?? UIColor.gray] navigationController?.navigationBar.barTintColor = tabBarController?.tabBar.barTintColor ?? UIColor.lightGray } diff --git a/ChameleonDemo/AppDelegate.swift b/ChameleonDemo/AppDelegate.swift index 3efbb64..ffda00b 100755 --- a/ChameleonDemo/AppDelegate.swift +++ b/ChameleonDemo/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { + public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { Chameleon.setGlobalThemeUsingPrimaryColor(.flatPlum, withSecondaryColor: .flatBlue, diff --git a/Extras/Chameleon.clr b/Extras/Chameleon.clr old mode 100644 new mode 100755 diff --git a/Extras/Chameleon.sketchpalette b/Extras/Chameleon.sketchpalette old mode 100644 new mode 100755 diff --git a/Extras/Chameleon_Photoshop.aco b/Extras/Chameleon_Photoshop.aco old mode 100644 new mode 100755 diff --git a/Extras/Chameleon_v2.clr b/Extras/Chameleon_v2.clr old mode 100644 new mode 100755 diff --git a/Pod/Classes/Objective-C/UIColor+Chameleon.m b/Pod/Classes/Objective-C/UIColor+Chameleon.m index 5c9ae8a..bc473df 100755 --- a/Pod/Classes/Objective-C/UIColor+Chameleon.m +++ b/Pod/Classes/Objective-C/UIColor+Chameleon.m @@ -950,6 +950,8 @@ - (void)getRGBAComponents:(CGFloat[4])rgba { rgba[3] = 1.0f; break; } + + default: break; } } diff --git a/README.md b/README.md old mode 100644 new mode 100755