Basically I am trying to implement an animation that will replace a label's text for a few seconds before returning to the original text. I have managed to get the label to change text and fade out after 3 seconds, however I can't figure out how to return the text to the original state after the animation is complete.
Here is what I currently have:
@IBAction func fade() {
userMessageLabel.alpha = 100
UIView.beginAnimations(nil, context: nil)
UIView.setAnimationDuration(3)
userMessageLabel.text = "Name is not valid!"
userMessageLabel.alpha = 0
UIView.commitAnimations()
}
I need the text label to return to "Please enter your first name"
Any help would be much appreciated.