Sunday, 26 November 2017

Animate



1. Rotate view 180 degree

Code -  let anticlockAnimation = CABasicAnimation(keyPath: "transform.rotation")
        anticlockAnimation.fromValue = CGFloat.pi
        anticlockAnimation.toValue = 0
        anticlockAnimation.isAdditive = true
        anticlockAnimation.duration = 3.0
        self.imageview.layer.add(anticlockAnimation, forKey: "rotate")
        self.imageview.transform = CGAffineTransform(rotationAngle: -CGFloat.pi)
       

2. 

No comments:

Post a Comment

Different type to create constraint programmatically

Do you plan to have a squared  UIView  of  width: 100  and  Height: 100  centered inside the  UIView of an  UIViewController ? If so, y...