Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andylindebros/lbdigit
Provides a digit view for SwiftUI projects
https://github.com/andylindebros/lbdigit
digit digitalclock swift swiftui
Last synced: about 1 month ago
JSON representation
Provides a digit view for SwiftUI projects
- Host: GitHub
- URL: https://github.com/andylindebros/lbdigit
- Owner: andylindebros
- License: mit
- Created: 2023-08-12T08:19:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-12T09:24:02.000Z (over 1 year ago)
- Last Synced: 2023-08-12T09:58:17.213Z (over 1 year ago)
- Topics: digit, digitalclock, swift, swiftui
- Language: Swift
- Homepage:
- Size: 95.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LBDigit
LBDigit provides a Digit written in Swift and SwiftUI.![Demo](https://github.com/andylindebros/LBDigit/blob/main/Docs/animation.gif)
## How to use.
### Install the Swift package
1. In Xcode, with your app project open, navigate to File > Add Packages.
2. When prompted, add LBDigit
```
https://github.com/andylindebros/LBDigit.git
```
3. Select the version that you want to use
4. Select the library.### How to use it
Add the Digit to your view.
```Swift
import LBDigitstruct ContentView: View {
var body: some View {
Digit(
value: 1, // Represents the number that should be presented as a digit
thickness: 10, // The thickness of the arms, Default is 10.
distance: 1, // The distance between the arms. Default is 1
color: Color.gray, // The color of the arms
highligtedColor: Color.red, // the highlighted color of the arms
applyHighlightedShaddow: true // Apply shadows to the hightlighted arms. Default is true
)
}
}
```### Available states:
- 0 - 9
- 10 represents a dash sign `-`
- 11 represents `e` as in error
- 12 represents no numberThis Swift package provides an example of how `LBDigit` can be used. Open the `LBDigitExample` in Xcode to find out more how it works.