kade

技術系の記事を書いていきます。

Objective-C: UIViewのアニメーションを停止する

[UIView animateWithDuration:1.0f delay:1.0f 
                        options:UIViewAnimationOptionCurveEaseIn
                   animations:^{
                     hoge.alpha = 0.0;
                   }
                   completion:^(BOOL finished) {
                     hoge:alpha = 1.0
                   }];

という感じでUIViewアニメを発動している最中に停止する方法です。 以下のようにすると止まります。

[hoge.layer removeAllAnimations];

全然swiftへの移行が出来てません・・・。