iOS 跷跷板动画 Seesaw Animation

2018/01/07 12:06
阅读数 10

 

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

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部