When animating UILabel frame size change it's working on iOS9 but not on iOS8 (on iOS8 it jump to final state instead animating). This problem disappear when using UIView or iOS9.
What can cause this problem? (You can see the project at https://github.com/IdoNave/UIlabelAnimation)
class MyView: UIView {
var progrssLabel: UILabel?
func startProgreesAnimation(from: CGFloat, duration: Double) {
if progrssLabel == nil {
progrssLabel = UILabel(frame: CGRect(x: 0, y: 0, width: frame.width * from, height: frame.height))
progrssLabel?.backgroundColor = UIColor.redColor()
self.addSubview(progrssLabel!)
}
UIView.animateWithDuration(duration, delay: 0, options: UIViewAnimationOptions.CurveEaseInOut, animations: {
self.progrssLabel!.frame = self.bounds
}) { (finish) in
print("ProgreesAnimation ended")
}
}
}