extension UIView
{
var anchorPoint:CGPoint {
get {
return self.layer.anchorPoint
}
set {
self.layer.anchorPoint = newValue
}
}
var x:CGFloat {
get {
return self.layer.position.x;
}
set {
self.layer.position.x = newValue
}
}
var y:CGFloat {
get {
return self.layer.position.y;
}
set {
self.layer.position.y = newValue
}
}
var position:CGPoint {
get {
return self.layer.position;
}
set {
self.layer.position = newValue;
}
}
var angle:CGFloat {
get{
return 0;
}
set {
var rad = M_PI/180
var v = newValue * CGFloat(rad)
self.transform = CGAffineTransformMakeRotation(v)
}
}
}