You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NumberMorphView a view like label for displaying numbers which animate with transition using a technique called number tweening or number morphing.
Usage
To run the example project, clone the repo, and run pod install from the Example directory first.
Interface builder
Drag a UIView into your view controller.
Change the class to NumberMorphView in the identity inspector.
Change intrinsic size from default to placeholder in the size inspector.
Create an IBOutlet in your view controller.
Set the digit of number view as shown below:
numberView.currentDigit =5;
Animate to nextDigit as shown below.
numberView.nextDigit =8;
From code
NumberMorphView can be used with or without auto layout. Usage of intrinsic content size is recommended.
Preferred aspect ratio of the view is 13 : 24.
Already available interpolators are LinearInterpolator, OvershootInterpolator, SpringInterpolator, BounceInterpolator, AnticipateOvershootInterpolator, and CubicHermiteInterpolator. Also you can add new interpolators. The interpolator class needs to conform to InterpolatorProtocol as shown below: