Building an application containing flashCards. They certainly require the ability to flip the card. For this, I have a UIViewController and, in order not to flip the whole view, I embedded my subView in the container.
I declared two subqueries in a container named frontViewand backView. frontViewreceived a red background and a label speaking in front, and backViewreceived a blue background and a label speaking in front .
I declared a variable, so I can check which side is highlighted: var showingFront = trueReceived a UIButton action that calls the following function:
if showingFront == true {
UIView.transitionFromView(forside, toView: bagside, duration: 1, options: UIViewAnimationOptions.TransitionFlipFromRight, completion: nil)
showingFront = false
} else {
UIView.transitionFromView(bagside, toView: forside, duration: 1, options: UIViewAnimationOptions.TransitionFlipFromRight, completion: nil)
showingFront = true
}
This flips the view back and forth, but does backgroundColor disappear with shortcuts, and I can only see the container overflow ?. All help is appreciated.