I used UIView.transition method to flip between 2 views, but after that, the frame of both views was changed.
if isFront {
UIView.transition(from: frontView, to: behindView, duration: 0.5, options: .transitionFlipFromRight,completion: { (finished) in
if finished {
self.isFront = false
}
})
} else {
UIView .transition(from: behindView, to: frontView, duration: 0.5, options: .transitionFlipFromLeft, completion: { (finished) in
if finished {
self.isFront = true
}
})
}
What is my wrong? Thanks for your helps.