Permalink
Browse files

Minor bugfix.

  • Loading branch information...
1 parent dbdc47d commit 78729c358d5b0857c078549af9428108c8b75ecc @mikeahmarani mikeahmarani committed Feb 22, 2012
Showing with 14 additions and 11 deletions.
  1. +13 −10 MAConfirmButton/MAConfirmButton.m
  2. +1 −1 Sample/Sample-Info.plist
View
23 MAConfirmButton/MAConfirmButton.m
@@ -294,10 +294,11 @@ - (void)lighten{
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
- if(!disabled && !confirmed && self.userInteractionEnabled){
- [self darken];
- }
- [super touchesBegan:touches withEvent:event];
+
+ if(!disabled && !confirmed && self.userInteractionEnabled){
+ [self darken];
+ }
+ [super touchesBegan:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
@@ -313,12 +314,14 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
cancelOverlay = nil;
[super touchesEnded:touches withEvent:event];
}else{
- [self lighten];
- self.selected = YES;
- cancelOverlay = [UIButton buttonWithType:UIButtonTypeCustom];
- [cancelOverlay setFrame:CGRectMake(0, 0, 1024, 1024)];
- [cancelOverlay addTarget:self action:@selector(cancel) forControlEvents:UIControlEventTouchDown];
- [self.superview addSubview:cancelOverlay];
+ [self lighten];
+ self.selected = YES;
+ if(!cancelOverlay){
+ cancelOverlay = [UIButton buttonWithType:UIButtonTypeCustom];
+ [cancelOverlay setFrame:CGRectMake(0, 0, 1024, 1024)];
+ [cancelOverlay addTarget:self action:@selector(cancel) forControlEvents:UIControlEventTouchDown];
+ [self.superview addSubview:cancelOverlay];
+ }
[self.superview bringSubviewToFront:self];
}
}
View
2 Sample/Sample-Info.plist
@@ -11,7 +11,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
- <string>com.mikeahmarani.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>com.mikeahmarani.sample</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

0 comments on commit 78729c3

Please sign in to comment.