Addev
Addev

Reputation: 32233

How to avoid an animation to disable touch interaction (scroll, swipe, etc)

Im trying to make an animation over a view in my ViewController.

My problem is that the scroll/swipe gestures over other elements like UITableViewControllers or UIPageViewControllers get disabled until the animation finishes.

How can I avoid this behaviour?

Upvotes: 1

Views: 465

Answers (1)

Rafał Sroka
Rafał Sroka

Reputation: 40030

Do your animations using allowUserInteraction option:

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

Upvotes: 4

Related Questions