Swift로 간단한 애니메이션을 만들려고합니다. 페이드 인입니다.
나는 시도했다 :
self.myFirstLabel.alpha = 0
self.myFirstButton.alpha = 0
self.mySecondButton.alpha = 0
그러면 다음이 있습니다.
self.view.addSubview(myFirstLabel)
self.view.addSubview(myFirstButton)
self.view.addSubview(mySecondButton)
그리고:
UIView.animateWithDuration(1.5, animations: {
self.myFirstLabel.alpha = 1.0
self.myFirstButton.alpha = 1.0
self.mySecondButton.alpha = 1.0
})
내 viewDidLoad 함수에이 모든 것이 있습니다.
이 작업을 어떻게 수행합니까?