Here's the only part that I changed:
Code: Select all
button = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pig.png"]];
button.backgroundColor = [UIColor blackColor];
button.bounds = CGRectMake(0, 0, SIZE, SIZE);
button.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(buttonClicked)];
[button addGestureRecognizer:tap];
Any ideas?