を使用してタッチイベントを強調表示しようとしていますがUIGestureRecognizer
、これまでのCGPoint
ところユーザーが触れた場所を取得できますが、アニメーションについてあまり知らないため、その特定の領域を強調表示する方法がわかりません。
これまでのコードviewDidLoad
:
UITapGestureRecognizer *singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gradientTouchDown:)];
[self addGestureRecognizer:singleFingerTap];
タッチの位置を取得するメソッド:
-(void)gradientTouchDown:(UIGestureRecognizer*)recognizer{
NSLog(@"tap detected.");
CGPoint point = [recognizer locationInView:nil];
NSLog(@"x = %f y = %f", point.x, point.y );
}
調べてみると、上記のコードにビューアニメーションを追加する必要があると思いますが、どうすればタッチを認識できますか? コード:
[UIView animateWithDuration:0.3f
delay:0.0
options:UIViewAnimationOptionCurveEaseIn
animations:^
{
[sender setAlpha:0.3f];
}
completion:^(BOOL finished)
{
[sender setAlpha:1.0f];
}];
これについて本当に助けが必要です。質問があれば、いつでもここにいます:)