Just instantiante a new FlipDigits view, specifying the number you want to display and, eventually, the minimum number of digits the view should display
import APFlipDigits
struct ContentView : View {
@State private var number : Int = 100
var body : some View {
FlipDigits(number: $number, minNumberOfDigits: 3)
}
}
You can customize the view specifying a FlipDigitsOptions, like in this example here:
import APFlipDigits
struct ContentView : View {
@State private var number : Int = 100
var body : some View {
FlipDigits(
number: $number,
minNumberOfDigits: 3,
options:.init(
cellSize: 70,
cellSpacing: 0,
cellColor: .blue,
foregroundColor: .yellow
)
)
}
}
Installation
Xcode Project
You have to select File -> Swift Packages -> Add Package Dependency and enter the repository url https://github.com/antoniopantaleo/APFlipDigits.git
Swift Package Manager
You have to add the package as a dependency in your Package.swift file
APFlipDigits
APFlipDigits is a SwiftUI package that lets you create an animated view capable of displaying numbers!
Features
Usage
Just instantiante a new
FlipDigits
view, specifying the number you want to display and, eventually, the minimum number of digits the view should displayYou can customize the view specifying a
FlipDigitsOptions
, like in this example here:Installation
Xcode Project
You have to select
File
->Swift Packages
->Add Package Dependency
and enter the repository urlhttps://github.com/antoniopantaleo/APFlipDigits.git
Swift Package Manager
You have to add the package as a dependency in your
Package.swift
fileLicense
MIT