Skip to content

Commit

Permalink
Fix missing types
Browse files Browse the repository at this point in the history
  • Loading branch information
3lvis committed Sep 2, 2016
1 parent f254dfc commit c56f7f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_VERSION = 2.3;
};
name = Debug;
};
Expand Down Expand Up @@ -1097,6 +1098,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 2.3;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down
12 changes: 10 additions & 2 deletions Sources/NetworkingImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,23 @@ 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
}

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
Expand Down

0 comments on commit c56f7f9

Please sign in to comment.