ios - UIAlertController freezes the UI when presented after pausing the layer animation
问题描述
In a ViewController
, I am performing a transition animation on a view. On a button action, the transition animation is paused by setting the layer speed equals to zero.
But, when the alert is presented over the screen after pausing the animation, the UI freezes and when I move the app from foreground to background and then again to foreground after some time, the alert action starts working. Does anybody have an idea of this issue?
func pauseLayer(layer: CALayer) {
let pausedTime: CFTimeInterval = layer.convertTime(CACurrentMediaTime(), from: nil)
layer.speed = 0.0
layer.timeOffset = pausedTime
}
Code for animation:
UIView.transition(with: self.rotatingView, duration: 1.0, options: [.transitionFlipFromLeft], animations: {
}) { (true) in
// print("completed")
}
解决方案
推荐阅读
- css - 如何自定义我的 FTP 的“网络浏览器”
- html - 如何将一个 div 居中放置在另一个 div 内(只是一个较小的矩形在一个大的矩形内)?
- node.js - Sails JS 无法将路径参数作为对象并且无法修改它
- r - 函数内的 updateRadioButtons
- dialog - 在 LibreOffice 中,如何创建两组连续的单选按钮
- python - 熊猫从不同文件夹中读取多个文件
- node.js - node-oracledb get the output parameter
- ruby-on-rails - How to dynamically increment a counter inside fields_for?
- c# - 安卓设备上的表面灯闪烁
- react-native - 无法在 react-native 中安装 npm