ScrollView having subviews with buttons are not clickable when UIViewPropertyAnimator is running

98 views Asked by At

I'm doing a slide animation using scrollView and UIViewPropertyAnimator.runningPropertyAnimator but I'm facing issue that the subviews buttons are not clickable, to verify that it is from the animation I stoped the animation code and the buttons start firing their actions

below is the code I'm using

 UIViewPropertyAnimator.runningPropertyAnimator(withDuration: Double(4 * self.data.count), delay: 0, options: .allowUserInteraction, animations: {
            guard self.data.count > 0 else { return }
            self.scrollView.contentOffset.x = self.cells[self.cells.count - 1].frame.maxX
        }) { (animatingPositionView) in
            switch animatingPositionView {
            case .current:
                break
            case .end:
                if self.scrollView.contentOffset.x == self.cells[self.cells.count - 1].frame.maxX {
                    self.scrollView.contentOffset.x = -self.frame.width
                    self.startScrolling()
                }
            case .start:
                break
            @unknown default:
                break
            }
        }
0

There are 0 answers