I have added images in scroll view. On long press i have given wobble animation to all images. i want to show delete button on the right top corner of every image as in iphone when we uninstall any application same like that.
- (void)startWobble {
for (UIView *imgView in viewsInScrollView) {
UIButton *deleteImgButton = [[UIButton alloc] initWithFrame:CGRectMake(55,-7,12,12)];
[deleteImgButton setImage:[UIImage imageNamed:@"close_icon.png"] forState:UIControlStateNormal];
[deleteImgButton addTarget:self action:@selector(deleteImage:) forControlEvents:UIControlEventTouchUpInside];
[imgView addSubview:deleteImgButton];
imgView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(-5));
[UIView animateWithDuration:0.20
delay:0.0
options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse)
animations:^ {
imgView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(5));
}
completion:NULL
];
}
}
-(void)deleteImage : (id)sender {
NSLog(@"Delete Image");
}
here the selector is not called.... how do i solve this..???