iPhoneプログラミングUIKit詳解リファレンスだとUITapGestureRecognizerの使い方がわからないのでEvent Handling Guide for iOSを見ながら、実装方法を確認する。
- (void)viewDidLoad {
[super viewDidLoad];
// Create and initialize a tap gesture
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(respondToTapGesture)];
// Specify that the gesture must be a single tap
tapRecognizer.numberOfTapsRequired = 1;
// Add the tap gesture recognizer to the view
[self.view addGestureRecognizer:tapRecognizer];
}
- (void)respondToTapGesture{
}
むちゃくちゃ簡単にできた。iPhoneプログラミングUIKit詳解リファレンス
posted with amazlet at 15.06.16
所 友太
リックテレコム
売り上げランキング: 126,924
リックテレコム
売り上げランキング: 126,924

0 コメント:
コメントを投稿