Animate UILabel text between two numbers?

后端 未结 6 689
遇见更好的自我
遇见更好的自我 2020-11-28 19:01

I\'m new to iPhone and Mac programming (developed for Windows before), and I\'ve got a question:

How do I animate the text property of an UILabel<

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 19:35

    In Swift 2.0, using the UIView.transitionWithView() method:

    UIView.transitionWithView(self.payPeriodSummaryLabel,
            duration: 0.2,
            options: [.CurveEaseInOut, .TransitionCrossDissolve],
            animations: { () -> Void in
                self.label.text = "your text value"
            }, completion: nil)
    

提交回复
热议问题