简体   繁体   中英

UIView animation not working - Xcode (Swift)

Example: I don't see any animation. Why?

UIView.animate(withDuration: 1, delay: 0, options: [.repeat, .autoreverse], animations: {
    self.buttonTrial.transform = CGAffineTransform(scaleX: 1.2, y: 1.2)
}, completion: { completion in
    self.buttonTrial.transform = .identity
})

Your code works fine. I removed the completion as it is not needed, but apart from that, this was done with exactly the code you've shown.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM