I want to animate the label from bottom to top when opening a view controller.
Can I Animated the label Without frameworks or pod file?
I want to animate the label from bottom to top when opening a view controller.
Can I Animated the label Without frameworks or pod file?
There's no need to use frameworks or pods for what you are trying to accomplish. You can simply use the following method and tweak the duration and distance to fit your needs.
UIView.animate(withDuration: 2, delay: 0, options: [.curveEaseOut],
animations: {
label.center.y -= self.view.bounds.height - 100
self.view.layoutIfNeeded()
}, completion: nil)
The "-100" is there so that you don't animate the label out of the view completely. If your label starts closer to the top you will need to increase this number and vice versa
Here transition example with Swift 1.2, from another question.
Swift 3, 4, 5
UIView.transition(with: status, duration: 0.33, options:
[.curveEaseOut, .transitionCurlDown], animations: {
//...animations
}, completion: {_ in
//....transition completion
delay(seconds: 2.0) {
}
})
Swift 2.0
UIView.transitionWithView(status, duration: 0.33, options:
[.CurveEaseOut, .TransitionCurlDown], animations: {
//...animations
}, completion: {_ in
//....transition completion
delay(seconds: 2.0) {
}
})
Swift 1.2
UIView.transitionWithView(status, duration: 0.33, options:
.CurveEaseOut | .TransitionCurlDown, animations: {
//...animations
}, completion: {_ in
//transition completion
delay(seconds: 2.0) {
}
})