我有一堆按钮,它们链接了一个 tapGestureRecognizer,这会执行适当的操作。
由于我有这么多按钮,我不想通过 IBAction 手动链接它们。
现在我收到的问题是它没有立即显示showsTouchOnHighlight。我不知道如何解决这个问题,这是我使用的代码:
- (void)tapPress:(UITapGestureRecognizer *)sender {
UIButton *resultButton = (UIButton *)sender.view;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard"
bundle:[NSBundle bundleForClass:[self class]]];
infoView *infoViewController = [storyboard instantiateViewControllerWithIdentifier:resultButton.currentTitle];
infoViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:infoViewController
animated:YES
completion:nil];
}