Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Swift 4.2 Migration
* Convert demo projects to Swift 4.2.  Ignore Pods.
* Fix compiler settings warning for Pods project.
* Fix for Pods compiler settings warning.
* Add shared workspace.
* Change .swift-version to 4.2.
  • Loading branch information
kcramer committed Sep 18, 2018
1 parent ac7a68c commit 8eec3c6
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .swift-version
@@ -1 +1 @@
4.0
4.2
8 changes: 4 additions & 4 deletions Demo/AppDelegate.swift
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application:UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
func application(_ application:UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {

MyThemes.restoreLastTheme()

Expand All @@ -31,9 +31,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

let titleAttributes = GlobalPicker.barTextColors.map { hexString in
return [
NSAttributedStringKey.foregroundColor: UIColor(rgba: hexString),
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 16),
NSAttributedStringKey.shadow: shadow
NSAttributedString.Key.foregroundColor: UIColor(rgba: hexString),
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16),
NSAttributedString.Key.shadow: shadow
]
}

Expand Down
10 changes: 5 additions & 5 deletions PlistDemo/AppDelegate.swift
Expand Up @@ -14,7 +14,7 @@ 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]?) -> Bool {

// default: Red.plist

Expand All @@ -30,17 +30,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

navigationBar.theme_tintColor = "Global.barTextColor"
navigationBar.theme_barTintColor = "Global.barTintColor"
navigationBar.theme_titleTextAttributes = ThemeDictionaryPicker(keyPath: "Global.barTextColor") { value -> [NSAttributedStringKey : AnyObject]? in
navigationBar.theme_titleTextAttributes = ThemeDictionaryPicker(keyPath: "Global.barTextColor") { value -> [NSAttributedString.Key : AnyObject]? in
guard let rgba = value as? String else {
return nil
}

let color = UIColor(rgba: rgba)
let shadow = NSShadow(); shadow.shadowOffset = CGSize.zero
let titleTextAttributes = [
NSAttributedStringKey.foregroundColor: color,
NSAttributedStringKey.font: UIFont.systemFont(ofSize: 16),
NSAttributedStringKey.shadow: shadow
NSAttributedString.Key.foregroundColor: color,
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 16),
NSAttributedString.Key.shadow: shadow
]

return titleTextAttributes
Expand Down
4 changes: 4 additions & 0 deletions Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions SwiftTheme.xcodeproj/project.pbxproj
Expand Up @@ -752,20 +752,20 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0900;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = Gesen;
TargetAttributes = {
186C86391C857AA900A5FFEA = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0800;
LastSwiftMigration = 1000;
};
18D642AC1C53613400DADEC5 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 1000;
};
18D642BB1C53615300DADEC5 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
LastSwiftMigration = 1000;
};
A34AD04D1CF6A7A900B54F53 = {
CreatedOnToolsVersion = 7.3.1;
Expand Down Expand Up @@ -1138,7 +1138,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "PlistDemo/PlistDemo-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1160,7 +1160,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.gesen.PlistDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "PlistDemo/PlistDemo-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -1176,12 +1176,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;
Expand Down Expand Up @@ -1232,12 +1234,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;
Expand Down Expand Up @@ -1323,7 +1327,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = me.gesen.Demo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1337,7 +1341,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = me.gesen.Demo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
8 changes: 8 additions & 0 deletions SwiftTheme.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

0 comments on commit 8eec3c6

Please sign in to comment.