Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Timer function
- func timerTextToggle(timer: NSTimer) {
- if self.animationOngoing == false {
- self.flipAnimation()
- }
- }
- // Animation function
- func flipAnimation() {
- // important note: it's UIViewAnimationOptions,
- // not UIViewAnimationTransition
- self.animationOngoing = true
- if self.animationToggle == false {
- UIView.transitionFromView(self.singleTapLabel!,
- toView: self.doubleTapLabel!,
- duration: animDuration,
- options: UIViewAnimationOptions.TransitionFlipFromBottom,
- completion: {
- (value: Bool) in
- self.animationOngoing = false
- })
- } else {
- UIView.transitionFromView(self.doubleTapLabel!,
- toView: self.singleTapLabel!,
- duration: animDuration,
- options: UIViewAnimationOptions.TransitionFlipFromTop,
- completion: {
- (value: Bool) in
- self.animationOngoing = false
- })
- }
- self.animationToggle = !self.animationToggle
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement