1
オンラインでいくつかの例を実行したところ、MKAnnotationViewをアニメーション化しようとしています。私は私のMKAnnotationViewサブクラスの()のinitに次のコードを配置した:とすぐに注釈ビューをマップに追加されているようMKAnnotationViewをアニメーション化しようとするとアプリケーションがクラッシュする
UIView.animate(withDuration: 10.0, delay: 0.0, options: .repeat, animations: {
UIView.addKeyframe(withRelativeStartTime: 0.0, relativeDuration: 0.5, animations: {
self.frame = biggerFrame
})
UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.5, animations: {
self.frame = originalFrame
})
}, completion: nil)
、以下の例外を除いて、アプリがクラッシュ:
2016-09-25 19:32:58.655 MyApp 42[62332:4524529] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[UIView addKeyframeWithStartTime:duration:animations:] must be called inside the animations block of +[UIView animateKeyframesWithDuration:delay:options:animations:completion:]'
私が間違っていることは何ですか?
ありがとうございます!
D'oh!私は将来、エラーメッセージを少し慎重に読むべきだと思う。 –