I have created a popup in swift using UIView and I want to bounce it when displaying, but I don't know how to do that. I want to make the same effect as seen below:
Asked
Active
Viewed 690 times
1 Answers
1
You should use UIView.animate with usingSpringWithDamping and initialSpringVelocity parameters. Eg:
// Change position of view
UIView.animate(withDuration: 1.0, delay: 0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 0.0, options: [], animations: {
// Call layoutIfNeeded()
})
Or you can change view's position in animation completion block. But it's not recommended.

Rodion Kuskov
- 146
- 1
- 5