高さと位置を変更して UIView をアニメーション化しようとしています。アニメ初ジャンプ?ストーリーボードで UIView (theView) のサイズを高さ 216 に設定しています。そのため、アプリが読み込まれ、theView が表示されます。theView をクリックすると、高さが 200 ピクセル以上に急速にジャンプし、アニメーション化されますか?
- (void)singleTapAction:(UIGestureRecognizer *)singleTap {
UIView *view = singleTap.view;
[UIView animateWithDuration:1.2 delay:0 options:UIViewAnimationCurveLinear | UIViewAnimationOptionAllowUserInteraction animations:^{
CGRect theFrame = self.theView.frame;
theFrame.size.height += 100.f; <!-- when it hits here the view jumps then animates
self.theView.frame = theFrame;
}
completion:^(BOOL finished) {
if(finished){
[UIView animateWithDuration:1.2 delay:0 options:UIViewAnimationCurveLinear | UIViewAnimationOptionAllowUserInteraction animations:^{
CGRect theFrame = self.theView.frame;
theFrame.origin.y -= 100.f;
self.theView.frame = theFrame;
}
completion:^(BOOL finished) {
NSLog(@"animations complete");
}];
}
}];
}