iOS 跷跷板动画 Seesaw Animation

 

Xcode Playgound示例代码:

        let testView = UIView()
        testView.frame = CGRect.init(x: 100, y: 100, width: 200, height: 200)
        self.view.addSubview(testView)
        testView.backgroundColor = UIColor.red
        
        var trans = CATransform3DIdentity
        trans.m34 = -1.0 / 500
        trans = CATransform3DRotate(trans, CGFloat.pi / 3, 1, 0, 0)
        UIView.animate(withDuration: 1, animations: {
            testView.layer.transform = trans
        }) { (finish) in
            UIView.animate(withDuration: 1, animations: {
                testView.layer.transform = CATransform3DIdentity
            })
        }

 

 

 


Ficow原创,转载请注明出处:http://www.cnblogs.com/ficow/p/8227709.html

posted @ 2018-01-07 12:06  Ficow  阅读(324)  评论(0编辑  收藏  举报