0

While flipping, the parent view fades into black (from white) to the middle of the animation, then fades into white again... Why?

My code:

    if !cardFrontView.isHidden {
        let transitionOptions: UIViewAnimationOptions = [.transitionFlipFromRight, .showHideTransitionViews]
        UIView.transition(from: cardFrontView, to: cardBackView, duration: 1.0, options: transitionOptions, completion: nil)
    }
    else {
        let transitionOptions: UIViewAnimationOptions = [.transitionFlipFromLeft, .showHideTransitionViews]
        UIView.transition(from: cardBackView, to: cardFrontView, duration: 1.0, options: transitionOptions, completion: nil)
    }

I also tried UIView.transition(with: but I have another problem there: round corners are disappearing.

Struggling all day with this... I mean that's all the code.

1 2 3 4

3
  • Try setting BaseView Color to clear if it helps you
    – iOS Geek
    Commented Jun 6, 2018 at 5:31
  • The base view color was white... setting it to transparent did the job! Thanks. Post the answer, and I will accept it.
    – Borzh
    Commented Jun 6, 2018 at 23:17
  • I did Posted , Happy to help
    – iOS Geek
    Commented Jun 7, 2018 at 4:06

1 Answer 1

1

Try setting BaseView Color to UIColor.clear instaed of UIColor.white

3
  • What is the BaseView color you are referring to? I have the same issue, but can't figure out how to sort it.
    – Niklas
    Commented Mar 20, 2019 at 15:08
  • @Niklas probably he means the superview/parent view. Commented Jun 6, 2019 at 13:16
  • 1
    Doesn't seem to make a difference though
    – Niklas
    Commented Jun 7, 2019 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.