Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何避免动画禁用触摸交互(滚动、滑动等)_Ios_Objective C_Swift - Fatal编程技术网

Ios 如何避免动画禁用触摸交互(滚动、滑动等)

Ios 如何避免动画禁用触摸交互(滚动、滑动等),ios,objective-c,swift,Ios,Objective C,Swift,我正在尝试在我的ViewController中的视图上制作动画 我的问题是,在动画完成之前,其他元素(如UITableViewController或UIPageViewController)上的滚动/滑动手势将被禁用 我怎样才能避免这种行为 使用allowUserInteraction选项制作动画: UIView.animate(withDuration: duration, delay: 0, options: .allowUserInteraction, animations:

我正在尝试在我的ViewController中的视图上制作动画

我的问题是,在动画完成之前,其他元素(如UITableViewController或UIPageViewController)上的滚动/滑动手势将被禁用


我怎样才能避免这种行为

使用
allowUserInteraction
选项制作动画:

UIView.animate(withDuration: duration, delay: 0, options: .allowUserInteraction,
       animations: {
           // Your animations here
       },
                completion: nil
)
看看这个: