UIView.animate //MARK: 弹簧自动放大缩小

2023-02-08  本文已影响0人  小黑技术

  //MARK: 弹簧自动放大缩小 

    @objc func Action(button: UIButton)

    {

        UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 6, initialSpringVelocity: 4, options: [], animations: {

            button.transform=CGAffineTransform(scaleX:1.1,y:1.1)

        },completion:nil)

        UIView.animate(withDuration: 0.5, delay: 0.6, usingSpringWithDamping: 2, initialSpringVelocity: 10, options: [], animations: {

            button.transform=CGAffineTransform.identity

        },completion:nil)

    }

上一篇 下一篇

猜你喜欢

热点阅读