[Swfit]UIView Extension #3

UIView Extension #3

func goto(left:CGFloat,top:CGFloat, duration:CGFloat=0.4){
    UIView.setAnimationBeginsFromCurrentState(true)
    UIView.animateWithDuration(NSTimeInterval(duration), delay: 0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 0.0, options: UIViewAnimationOptions.CurveEaseInOut,
        animations: { () -> Void in
            self.left = left
            self.top = top
        },
        completion: { (finish:Bool) -> Void in
            
        }
    )
}