Skip to content

Commit

Permalink
Update for Swift 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Smith committed Sep 18, 2018
1 parent 343bff9 commit e1c6c78
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
20 changes: 16 additions & 4 deletions Cache.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,8 @@
};
D5291D171C2837DB00B702C9 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0900;
DevelopmentTeam = 55622V7SY7;
LastSwiftMigration = 1000;
};
D5291D5F1C283B5300B702C9 = {
CreatedOnToolsVersion = 7.2;
Expand All @@ -647,7 +648,8 @@
};
D5DC59DF1C20593E003BD79B = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
DevelopmentTeam = 55622V7SY7;
LastSwiftMigration = 1000;
};
};
};
Expand Down Expand Up @@ -1029,26 +1031,30 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = 55622V7SY7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/Tests/iOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-iOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
D5291D221C2837DB00B702C9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = 55622V7SY7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/Tests/iOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-iOS-Tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down Expand Up @@ -1241,8 +1247,10 @@
D5DC59F51C20593E003BD79B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 55622V7SY7;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -1254,6 +1262,8 @@
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.Cache;
PRODUCT_NAME = Cache;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1273,6 +1283,8 @@
PRODUCT_BUNDLE_IDENTIFIER = no.hyper.Cache;
PRODUCT_NAME = Cache;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions Source/iOS/UIImage+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extension UIImage {
/// Convert to data
func cache_toData() -> Data? {
return hasAlpha
? UIImagePNGRepresentation(self)
: UIImageJPEGRepresentation(self, 1.0)
? self.pngData()
: self.jpegData(compressionQuality: 1.0)
}
}
4 changes: 2 additions & 2 deletions Tests/Shared/TestHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ struct TestHelper {

static func triggerApplicationEvents() {
#if !os(macOS)
NotificationCenter.default.post(name: .UIApplicationDidEnterBackground, object: nil)
NotificationCenter.default.post(name: .UIApplicationWillTerminate, object: nil)
NotificationCenter.default.post(name: UIApplication.didEnterBackgroundNotification, object: nil)
NotificationCenter.default.post(name: UIApplication.willTerminateNotification, object: nil)
#else
NotificationCenter.default.post(name: NSApplication.willTerminateNotification, object: nil)
NotificationCenter.default.post(name: NSApplication.didResignActiveNotification, object: nil)
Expand Down

0 comments on commit e1c6c78

Please sign in to comment.