0

以下の流れのようなデザインをしています。5 番目と 6 番目のステップの間に 0.3 秒の遅延を設定する必要があります。以下のオプションを試しましたが、結果が得られませんでした。

私の質問は、どうすればこれを達成できますか?

注: アニメーションを見るのに 13 秒かかります。

フロー

  1. Task Handler // webService リクエスト用
  2. Closure Handler // トリガー ViewController 用
  3. DispatchQueue.main.async // UI の更新用
  4. 最初のアニメーション
  5. セカンドアニメーション
  6. 次の画面へのナビゲーション

テスト 1

Timer.scheduledTimer(withTimeInterval: 13, repeats: false, block: {})

テスト 2

UIView.animate(withDuration: 13, animations: {
    // nothing should be happened
    self.ivSuccessMark.alpha = 0.99 // for dummy animation diff
}, completion: { (completion) in
    // navigation
})

テスト 3

実行 (_:with:afterDelay:)

4

2 に答える 2

0

これを試してみてください

UIView.animate(withDuration: 0.5, delay: 0.3, options: [.repeat, .curveEaseOut, .autoreverse], animations: {
    // animation stuff      
}, completion: { _ in
    // do stuff once animation is complete
})
于 2018-06-21T09:06:06.423 に答える