@@ -84,14 +84,6 @@ - (void)parseImageSetAtURL:(NSURL *)url;
84
84
return ;
85
85
}
86
86
87
- NSUInteger resizableIndex = [[contents[@" images" ]valueForKey: @" resizing" ]indexOfObjectPassingTest: ^BOOL (id obj,NSUInteger idx,BOOL *stop) {
88
- return obj != [NSNull null ];
89
- }];
90
-
91
- if (resizableIndex ==NSNotFound ) {
92
- return ;
93
- }
94
-
95
87
NSString *interface = [NSString stringWithFormat: @" + (UIImage *)imageFor%@ ;\n " , name];
96
88
@synchronized (self.interfaceContents ) {
97
89
[self .interfaceContentsaddObject: interface];
@@ -119,13 +111,18 @@ - (void)parseImageSetAtURL:(NSURL *)url;
119
111
[implementationappendFormat: @" %@ if ([UIScreen mainScreen].scale ==%.1f f) {\n " , indentation, scale];
120
112
[implementationappendFormat: @" %@ UIImage *baseImage = [UIImage imageNamed:@\" %@ \" ];\n " , indentation, filename];
121
113
122
- CGFloat top = [variant[@" resizing" ][@" capInsets" ][@" top" ]floatValue ] / scale;
123
- CGFloat left = [variant[@" resizing" ][@" capInsets" ][@" left" ]floatValue ] / scale;
124
- CGFloat bottom = [variant[@" resizing" ][@" capInsets" ][@" bottom" ]floatValue ] / scale;
125
- CGFloat right = [variant[@" resizing" ][@" capInsets" ][@" right" ]floatValue ] / scale;
126
- NSString *mode = [variant[@" resizing" ][@" center" ][@" mode" ]isEqualToString: @" stretch" ] ?@" UIImageResizingModeStretch" :@" UIImageResizingModeTile" ;
127
-
128
- [implementationappendFormat: @" %@ return [baseImage resizableImageWithCapInsets:UIEdgeInsetsMake(%.1f f,%.1f f,%.1f f,%.1f f) resizingMode:%@ ];\n " , indentation, top, left, bottom, right, mode];
114
+ NSDictionary *resizing = variant[@" resizing" ];
115
+ if (resizing) {
116
+ CGFloat top = [resizing[@" capInsets" ][@" top" ]floatValue ] / scale;
117
+ CGFloat left = [resizing[@" capInsets" ][@" left" ]floatValue ] / scale;
118
+ CGFloat bottom = [resizing[@" capInsets" ][@" bottom" ]floatValue ] / scale;
119
+ CGFloat right = [resizing[@" capInsets" ][@" right" ]floatValue ] / scale;
120
+ NSString *mode = [resizing[@" center" ][@" mode" ]isEqualToString: @" stretch" ] ?@" UIImageResizingModeStretch" :@" UIImageResizingModeTile" ;
121
+
122
+ [implementationappendFormat: @" %@ return [baseImage resizableImageWithCapInsets:UIEdgeInsetsMake(%.1f f,%.1f f,%.1f f,%.1f f) resizingMode:%@ ];\n " , indentation, top, left, bottom, right, mode];
123
+ }else {
124
+ [implementationappendFormat: @" %@ return baseImage;\n " , indentation];
125
+ }
129
126
130
127
[implementationappendFormat: @" %@ }\n " , indentation];
131
128