現在の位置からアニメーションし移動する
UIViewクラスのanimateWithDurationクラスで、self.****.centerの座標を指定してやれば、指定した秒数の移動アニメーションになります。
//タップされた座標にアザラシをアニメーションで移動させる
[UIView animateWithDuration:2.0 //2秒間のアニメーション
delay:0
options:animeOptions
animations:^{
self.azarashi.center = tapLoc; //移動
}
completion:nil];
- 関連記事
-
-
アニメーションの連結 2014/12/31
-
現在の位置からアニメーションし移動する 2014/12/31
-
タップされた座標を調べる 2014/12/31
-