How to create a controllable flip effect (flip as far (and fast) as you drag) of an UIView
- by allisone
I have a card (a flashcard you could say)
What I can do:
On fingersweeping over the flashcard the card gets turned. It's happening by detecting
touchesBegan and touchesMoved and then I do stuff like
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
if (left) {
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:self.flashCardView cache:YES];
}else{
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromRight forView:self.flashCardView cache:YES];
}
What I can't do (but want to):
I want to somehow drag the flip.
Imagine this, you have a flashcard and you think you know the answer, you start flipping the card around because you want to see if you are correct, but then... no stop... you hesitate, turn back the card to the way it was, rethink, get the real answer and then finally flip to see that you were right to hesitate.
Now I only have: once you start flipping, you can't stop it.