Skip to content

Commit c56f7f9

Browse files
committed
Fix missing types
1 parent f254dfc commit c56f7f9

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Demo.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,7 @@
10591059
MTL_ENABLE_DEBUG_INFO = YES;
10601060
ONLY_ACTIVE_ARCH = YES;
10611061
SDKROOT = iphoneos;
1062+
SWIFT_VERSION = 2.3;
10621063
};
10631064
name = Debug;
10641065
};
@@ -1097,6 +1098,7 @@
10971098
MTL_ENABLE_DEBUG_INFO = NO;
10981099
SDKROOT = iphoneos;
10991100
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
1101+
SWIFT_VERSION = 2.3;
11001102
VALIDATE_PRODUCT = YES;
11011103
};
11021104
name = Release;

Sources/NetworkingImage.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,23 @@ extension NetworkingImage {
3232

3333
func pngData() -> NSData? {
3434
#if os(OSX)
35-
return self.data(type: .PNG)
35+
#if swift(>=2.3)
36+
return self.data(type: .PNG)
37+
#else
38+
return self.data(type: .NSPNGFileType)
39+
#endif
3640
#else
3741
return UIImagePNGRepresentation(self)
3842
#endif
3943
}
4044

4145
func jpgData() -> NSData? {
4246
#if os(OSX)
43-
return self.data(type: .JPEG)
47+
#if swift(>=2.3)
48+
return self.data(type: .JPEG)
49+
#else
50+
return self.data(type: .NSJPEGFileType)
51+
#endif
4452
#else
4553
return UIImageJPEGRepresentation(self, 1)
4654
#endif

0 commit comments

Comments
 (0)