I have a very simple project, I want to animate the right margin on a label, however when I try it, it finishes instantly.
@IBAction func onDo(sender:UIButton)
{
self.view.setNeedsLayout()
self.testConstraint.constant = 40.0
UIView.animateWithDuration(2.0, animations: { () -> Void in
self.view.setNeedsLayout()
}) { (complete:Bool) -> Void in
}
}
The project is here:
https://www.dropbox.com/s/9a0v0906riunkww/test2222.zip?dl=0
Am I missing something obvious?
Update #1
It seems it's a problem with UILabels specifically, a standard UIView, or UIButton animates fine....so whats wrong with a UILabel?
Update #2
If I set the UILabel View Content Mode to Center, then it works fine, but it doesn't look very smooth...very strange.