I've created an animation block using UIView animations - but the animation is triggered on the UITextView for every letter the player types (it's a typing game). The moment a new letter is typed, it instantly completes the previous character's animation - no overlap is possible. How would I allow for multiple animations to start and finish without interrupting each one?
Current animation block:
UIView.transitionWithView(textViewForPlayer, duration: 0.1, options: .BeginFromCurrentState | .TransitionCrossDissolve | .AllowAnimatedContent, animations: {
self.textForPlayer.addAttribute(
NSForegroundColorAttributeName,
value: UIColor.clearColor(),
range: nsRangeOfTextShown)
self.textViewForPlayer.attributedText = self.textForPlayer
}, completion: { finished in
UIView.transitionWithView(self.textViewForPlayer, duration: 2.1, options: .BeginFromCurrentState | .TransitionCrossDissolve | .AllowAnimatedContent, animations: {
self.textForPlayer.addAttribute(
NSForegroundColorAttributeName,
value: UIColor.greenColor(),
range: nsRangeOfTextShown)
self.textViewForPlayer.attributedText = self.textForPlayer
}, completion: { finished in
})
println("FINISHED2")
}
)