Skip to content

Commit

Permalink
Default build with Swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Feb 25, 2019
1 parent ccb26a8 commit e185e37
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 22 deletions.
14 changes: 2 additions & 12 deletions Demo/Kingfisher-Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
};
name = Debug;
};
Expand All @@ -721,7 +720,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
};
name = Release;
};
Expand All @@ -741,7 +739,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = appletvos;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = 3;
};
name = Debug;
Expand All @@ -763,7 +760,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = appletvos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = 3;
};
name = Release;
Expand All @@ -782,7 +778,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = 4;
};
name = Debug;
Expand All @@ -801,7 +796,6 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
TARGETED_DEVICE_FAMILY = 4;
};
name = Release;
Expand All @@ -824,7 +818,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
TARGETED_DEVICE_FAMILY = 4;
};
name = Debug;
Expand All @@ -847,7 +840,6 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = watchos;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
TARGETED_DEVICE_FAMILY = 4;
};
name = Release;
Expand Down Expand Up @@ -904,7 +896,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 10.0;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
Expand Down Expand Up @@ -955,7 +947,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALIDATE_PRODUCT = YES;
Expand All @@ -973,7 +965,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
};
name = Debug;
};
Expand All @@ -988,7 +979,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.onevcat.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
};
name = Release;
};
Expand Down
14 changes: 10 additions & 4 deletions Kingfisher.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -859,11 +859,11 @@
};
D1ED2D341AD2D09F00CFC3EB = {
CreatedOnToolsVersion = 6.2;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
D1ED2D3E1AD2D09F00CFC3EB = {
CreatedOnToolsVersion = 6.2;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
};
};
Expand Down Expand Up @@ -1413,6 +1413,8 @@
SDKROOT = appletvos;
SWIFT_OBJC_BRIDGING_HEADER = "Tests/KingfisherTests/KingfisherTests-Bridging-Header.h";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = "";
TARGETED_DEVICE_FAMILY = 3;
};
name = Debug;
};
Expand All @@ -1431,6 +1433,8 @@
SWIFT_OBJC_BRIDGING_HEADER = "Tests/KingfisherTests/KingfisherTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_VERSION = "";
TARGETED_DEVICE_FAMILY = 3;
};
name = Release;
};
Expand Down Expand Up @@ -1638,7 +1642,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 10.0;
WATCHOS_DEPLOYMENT_TARGET = 3.0;
Expand Down Expand Up @@ -1689,7 +1693,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALIDATE_PRODUCT = YES;
Expand Down Expand Up @@ -1763,6 +1767,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Tests/KingfisherTests/KingfisherTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1778,6 +1783,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Tests/KingfisherTests/KingfisherTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions Sources/Extensions/NSButton+Kingfisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,15 @@ extension KingfisherWrapper where Base: NSButton {
extension KingfisherWrapper where Base: NSButton {

/// Gets the image URL bound to this button.
@available(*, obsoleted: 5.0, message: "Use `taskIdentifier` instead to identify a setting task.")
@available(*, deprecated, message: "Use `taskIdentifier` instead to identify a setting task.")
public private(set) var webURL: URL? {
get { return nil }
set { }
}


/// Gets the image URL bound to this button.
@available(*, obsoleted: 5.0, message: "Use `alternateTaskIdentifier` instead to identify a setting task.")
@available(*, deprecated, message: "Use `alternateTaskIdentifier` instead to identify a setting task.")
public private(set) var alternateWebURL: URL? {
get { return nil }
set { }
Expand Down
2 changes: 1 addition & 1 deletion Sources/Extensions/WKInterfaceImage+Kingfisher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ extension KingfisherWrapper where Base: WKInterfaceImage {

extension KingfisherWrapper where Base: WKInterfaceImage {
/// Gets the image URL bound to this image view.
@available(*, obsoleted: 5.0, message: "Use `taskIdentifier` instead to identify a setting task.")
@available(*, deprecated, message: "Use `taskIdentifier` instead to identify a setting task.")
public private(set) var webURL: URL? {
get { return nil }
set { }
Expand Down
2 changes: 1 addition & 1 deletion Sources/Image/Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ extension KingfisherWrapper where Base: Image {
guard let animatedImage = GIFAnimatedImage(from: imageSource, for: info, options: options) else {
return nil
}
let image: Image?
var image: Image?
if options.onlyFirstFrame {
image = animatedImage.images.first
} else {
Expand Down
4 changes: 2 additions & 2 deletions Tests/KingfisherTests/ImageCacheTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ class ImageCacheTests: XCTestCase {

XCTAssertEqual(hashes.count, 1)
XCTAssertEqual(hashes.first!, self.cache.hash(forKey: key))

NotificationCenter.default.removeObserver(self.observer)
guard let o = self.observer else { return }
NotificationCenter.default.removeObserver(o)
exp.fulfill()
}

Expand Down

0 comments on commit e185e37

Please sign in to comment.