RBSOdometer is an Objective-C library for smoothly animating number transitions with customizable effects, perfect for displaying changing numerical values with visual appeal.
- 🎯 Smooth number transition animations
- ⚡ Customizable animation duration and density
- 🎨 Configurable text color and font
- 📱 Auto Layout support
- 🔄 Efficient view reuse with RBSReuseQueue
- 🛠️ Easy to integrate and use
- iOS 11.0+
- Xcode 15.0+
- Tuist (for project generation)
- Install Tuist using Mise (recommended):
# Install Mise
curl https://mise.run | sh
# Install Tuist
mise use tuist@4.0.0Or install via Homebrew (note: may install a newer version):
brew install tuist- Add RBSOdometer to your
Dependencies.swift:
import ProjectDescription
let dependencies = Dependencies(
swiftPackageManager: SwiftPackageManagerDependencies([
.remote(
url: "https://github.com/RbBtSn0w/RBSOdometer.git",
requirement: .upToNextMajor(from: "0.2.0")
)
])
)- Add as a dependency in your
Project.swift:
.target(
name: "YourApp",
dependencies: [
.external(name: "RBSOdometer")
]
)- Clone the repository
- Add
RBSOdometer/Classes/*.{h,m}files to your project - Add the dependency: RBSReuseQueue
#import "RBSOdometerView.h"
// Create an odometer view
RBSOdometerView *odometerView = [[RBSOdometerView alloc] initWithFrame:CGRectMake(0, 0, 200, 50)];
// Configure appearance
odometerView.textColor = [UIColor blackColor];
odometerView.font = [UIFont systemFontOfSize:32];
// Set animation properties
odometerView.duration = 1.0; // Animation duration in seconds
odometerView.density = 5; // Number density for animation
// Animate to a new value
[odometerView setNumber:@"12345"];
// Add to your view hierarchy
[self.view addSubview:odometerView];To run the example project:
git clone https://github.com/RbBtSn0w/RBSOdometer.git
cd RBSOdometer
tuist install
tuist generate
open RBSOdometer.xcworkspaceThen build and run the RBSOdometerExample scheme.
For detailed API documentation, see the header files:
We welcome contributions! Please see our Contributing Guide for details.
RbBtSn0w
- Email: hamiltonsnow@gmail.com
- Twitter: @RbBtSn0w
RBSOdometer is available under the MIT license. See the LICENSE file for more details.
- Built with Tuist for modern Xcode project management
- Uses RBSReuseQueue for efficient view reuse
