in my playground I need to repeat this func
func changeButton () {
UIView.animate(withDuration: 1.0, delay: 1.0, animations: { () -> Void in
button.titleLabel?.alpha = 0.0
}) { (_finished: Bool) -> Void in
button.setTitle("Text", for: .normal)
UIView.animate(withDuration: 1.0, delay: 0.0, animations: { () -> Void in
button.titleLabel?.alpha = 1.0
}) { (_finished: Bool) -> Void in
UIView.animate(withDuration: 1.0, delay: 1.0, animations: { () -> Void in
button.titleLabel?.alpha = 0.0
}) { (_finished: Bool) -> Void in
button.setTitle("Cacca", for: .normal)
UIView.animate(withDuration: 1.0, delay: 0.0, animations: { () -> Void in
button.titleLabel?.alpha = 1.0
})
}
}
I tried to repeat the func with this while loop but doesn't work, someone can help me?
repeat{
changeButton()
} while(true)