@UIButton UIControlEventTouchUpInside não dispara, mas o UIControlEventTouchDown dispara
Estou implementandoUIButton
e meuUIControlEventTouchUpInside
evento não dispara, mesmo queUIControlEventTouchDown
dispara.
UIButton *btnClose = [UIButton buttonWithType:UIButtonTypeCustom];
NSString *filePathImage = @"img.png";
NSString *filePathImageTap = @"img-tap.png";
UIImage *buttonImage = [UIImage imageWithContentsOfFile:filePathImage];
UIImage *buttonImageTap = [UIImage imageWithContentsOfFile:filePathImageTap];
[btnClose setImage:buttonImage forState:UIControlStateNormal];
[btnClose setImage:buttonImageTap forState:UIControlStateSelected];
[btnClose setImage:buttonImageTap forState:UIControlStateHighlighted];
[btnClose addTarget:self action:@selector(close:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btnClose];