¿Hacer un simple desvanecimiento en la animación en Swift?
Estoy tratando de hacer una animación simple en Swift. Es un desvanecimiento en.
Lo intenté:
self.myFirstLabel.alpha = 0
self.myFirstButton.alpha = 0
self.mySecondButton.alpha = 0
Luego tengo:
self.view.addSubview(myFirstLabel)
self.view.addSubview(myFirstButton)
self.view.addSubview(mySecondButton)
Y entonces:
UIView.animateWithDuration(1.5, animations: {
self.myFirstLabel.alpha = 1.0
self.myFirstButton.alpha = 1.0
self.mySecondButton.alpha = 1.0
})
Tengo todo esto en mi función viewDidLoad.
¿Cómo hago para que esto funcione?