From c56f7f9e04d724f93149d04e22830bdb984faa56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elvis=20Nu=C3=B1ez?= Date: Fri, 2 Sep 2016 13:31:45 +0200 Subject: [PATCH] Fix missing types --- Demo.xcodeproj/project.pbxproj | 2 ++ Sources/NetworkingImage.swift | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Demo.xcodeproj/project.pbxproj b/Demo.xcodeproj/project.pbxproj index 90eb25d..044fb1c 100755 --- a/Demo.xcodeproj/project.pbxproj +++ b/Demo.xcodeproj/project.pbxproj @@ -1059,6 +1059,7 @@ MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -1097,6 +1098,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 2.3; VALIDATE_PRODUCT = YES; }; name = Release; diff --git a/Sources/NetworkingImage.swift b/Sources/NetworkingImage.swift index b3dfe07..dbd1982 100644 --- a/Sources/NetworkingImage.swift +++ b/Sources/NetworkingImage.swift @@ -32,7 +32,11 @@ extension NetworkingImage { func pngData() -> NSData? { #if os(OSX) - return self.data(type: .PNG) + #if swift(>=2.3) + return self.data(type: .PNG) + #else + return self.data(type: .NSPNGFileType) + #endif #else return UIImagePNGRepresentation(self) #endif @@ -40,7 +44,11 @@ extension NetworkingImage { func jpgData() -> NSData? { #if os(OSX) - return self.data(type: .JPEG) + #if swift(>=2.3) + return self.data(type: .JPEG) + #else + return self.data(type: .NSJPEGFileType) + #endif #else return UIImageJPEGRepresentation(self, 1) #endif