I'm struggling to figure out how to allow user interaction with a view as it's being animated.

Here's the situation: I have a UIView cardView which holds card subviews. The cards are draggable tiles, similar to how the cards in Tinder are draggable/swipeable.

I am trying to fade out the card using animateWithDuration by animating to cardView.alpha = 0. Logically, this will also fade out all of the subviews (card objects). In this specific case, I am only targeting one card subview. However, during the animation, I am unable to drag/interact with the card.

Here is the code I'm using:

UIView.animateWithDuration(
        duration,
        delay: 0,
        options: UIViewAnimationOptions.AllowUserInteraction,
        animations: {self.cardView.alpha = 0}
    ) {
        _ in
        println("Card faded out")
        card.removeFromSuperview()
    }

Why doesn't this work? Any help will be appreciated. Thank you!!

Related posts

Recent Viewed