func angle2Radian(offset:Double,ref:Double)->Double { return offset * M_PI / ref; }
var transfrom:CATransform3D = CATransform3DIdentity let d:CGFloat = 300 transfrom.m34 = -1 / d transfrom = CATransform3DRotate(transfrom,CGFloat(angle2Radian(offset: 30,ref: 200)),1,0) view.layer.transform = transfrom原文链接:https://www.f2er.com/swift/322612.html