home, SWIFT, updated

how to make animation in swift?

To perform animation in swift, you can use following code

        UIView.animate(withDuration: 0.5){
          // Do your code here
        }

if you want to add delay time

        UIView.animate(withDuration: 0.5, delay : 1.0){
          // Do your code here
        }

if you want to add on complete function

       UIView.animate(withDuration: 0.5, animations:{
         // Do you animation code here
        }, completion: {_ in
            // Do your after completion code here
        })

Related Articles

post a comment