Open lsantaniello opened 8 years ago
I updated 'MDScratchSampleViewController.h' for testing your problem...
#pragma mark - MDScratchImageViewDelegate
- (void)mdScratchImageView:(MDScratchImageView *)scratchImageView didChangeMaskingProgress:(CGFloat)maskingProgress {
NSLog(@"%s %p progress == %.2f", __PRETTY_FUNCTION__, scratchImageView, maskingProgress);
//Button test
static BOOL isPresented = NO;
if(maskingProgress > 0.5 && isPresented == NO){
isPresented = YES;
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn setImage:[UIImage imageNamed:@"paint01-02blur"] forState:UIControlStateNormal];
btn.frame = CGRectMake(50, 50, 100, 100);
[btn addTarget:self action:@selector(btnAction) forControlEvents:UIControlEventTouchUpInside];
[scratchImageView addSubview:btn];
}
}
-(void)btnAction{
NSLog(@"%s", __PRETTY_FUNCTION__);
}
This is works fine. Please, check your button and button superviews user interaction. Check your button target action.
Hi, I need to add a new button on scratchView when the progres is +0.9. When I add the button, it is not clickable. How can I solve the problem?
Thanks