@@ -172,23 +172,23 @@ -(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event{
172
172
[self setNeedsDisplay ];
173
173
}
174
174
175
- - (void )setSelected : (BOOL )selected {
175
+ -(void )setSelected : (BOOL )selected {
176
176
[super setSelected: selected];
177
177
[self setNeedsDisplay ];
178
178
}
179
179
180
- - (void )setHighlighted : (BOOL )highlighted {
180
+ -(void )setHighlighted : (BOOL )highlighted {
181
181
[super setHighlighted: highlighted];
182
182
[self setNeedsDisplay ];
183
183
}
184
184
185
- - (void )setTintColor : (UIColor *)tintColor {
185
+ -(void )setTintColor : (UIColor *)tintColor {
186
186
if ([super respondsToSelector: @selector (setTintColor: )]){
187
187
[super setTintColor: tintColor];
188
188
}
189
189
}
190
190
191
- - (void )tintColorDidChange {
191
+ -(void )tintColorDidChange {
192
192
[self setNeedsDisplay ];
193
193
}
194
194
@@ -201,9 +201,9 @@ @interface MMDrawerBarButtonItem ()
201
201
202
202
@implementation MMDrawerBarButtonItem
203
203
204
- + (UIImage*) drawerButtonItemImage {
204
+ +(UIImage*)drawerButtonItemImage {
205
205
206
- static UIImage* drawerButtonImage = nil ;
206
+ static UIImage * drawerButtonImage = nil ;
207
207
static dispatch_once_t onceToken;
208
208
dispatch_once (&onceToken, ^{
209
209
@@ -240,11 +240,11 @@ + (UIImage*) drawerButtonItemImage{
240
240
241
241
-(id )initWithTarget : (id )target action : (SEL )action {
242
242
243
- if ( [[[UIDevice currentDevice ] systemVersion ] floatValue ] >= 7.0 ){
244
- return [self initWithImage: [self .class drawerButtonItemImage ]
245
- style: UIBarButtonItemStylePlain
246
- target: target
247
- action: action];
243
+ if (( floor ( NSFoundationVersionNumber ) > NSFoundationVersionNumber_iOS_6_1) ){
244
+ return [self initWithImage: [self .class drawerButtonItemImage ]
245
+ style: UIBarButtonItemStylePlain
246
+ target: target
247
+ action: action];
248
248
}
249
249
else {
250
250
MMDrawerMenuButtonView * buttonView = [[MMDrawerMenuButtonView alloc ] initWithFrame: CGRectMake (0 , 0 , 26 , 26 )];
@@ -260,20 +260,16 @@ -(id)initWithTarget:(id)target action:(SEL)action{
260
260
}
261
261
262
262
-(id )initWithCoder : (NSCoder *)aDecoder {
263
-
264
263
// non-ideal way to get the target/action, but it works
265
- UIBarButtonItem* bbi = [[UIBarButtonItem alloc ] initWithCoder: aDecoder];
266
-
267
- return [self initWithTarget: bbi.target action: bbi.action];
264
+ UIBarButtonItem* barButtonItem = [[UIBarButtonItem alloc ] initWithCoder: aDecoder];
265
+ return [self initWithTarget: barButtonItem.target action: barButtonItem.action];
268
266
}
269
267
270
268
-(void )touchUpInside : (id )sender {
271
269
272
270
#pragma clang diagnostic push
273
- #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
274
-
275
- [self .target performSelector: self .action withObject: self ];
276
-
271
+ #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
272
+ [self .target performSelector: self .action withObject: sender];
277
273
#pragma clang diagnostic pop;
278
274
279
275
}
@@ -294,7 +290,7 @@ -(void)setShadowColor:(UIColor *)color forState:(UIControlState)state{
294
290
[self .buttonView setShadowColor: color forState: state];
295
291
}
296
292
297
- - (void )setTintColor : (UIColor *)tintColor {
293
+ -(void )setTintColor : (UIColor *)tintColor {
298
294
if ([super respondsToSelector: @selector (setTintColor: )]){
299
295
[super setTintColor: tintColor];
300
296
}
0 commit comments