Skip to content

Commit

Permalink
Minor bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeahmarani committed Feb 22, 2012
1 parent dbdc47d commit 78729c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions MAConfirmButton/MAConfirmButton.m
Expand Up @@ -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{
Expand All @@ -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];
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sample/Sample-Info.plist
Expand Up @@ -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>
Expand Down

0 comments on commit 78729c3

Please sign in to comment.