I want to animate my UIPickerView after pressing the button. I already have coded my UIPickerView to be hidden on viewDidLoad and not hidden after pressing a button, but it does
I agree with @EshwarChaitanya, the alpha property is animatable and this is an appropriate use.
override func viewDidLoad() {
super.viewDidLoad()
timersPickerView.alpha = 0
}
@IBAction func selectTimer() {
UIView.animate(withDuration: 0.3, animations: {
self.timersPickerView.alpha = 1
})
}
I am not sure how you want to hide it so I will leave it up to you.