https://github.com/fluidgroup/transitionpatch
Declarative sequence for converting value.
https://github.com/fluidgroup/transitionpatch
Last synced: 7 months ago
JSON representation
Declarative sequence for converting value.
- Host: GitHub
- URL: https://github.com/fluidgroup/transitionpatch
- Owner: FluidGroup
- License: mit
- Created: 2019-05-13T06:06:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-28T19:34:02.000Z (over 4 years ago)
- Last Synced: 2025-09-10T14:06:58.595Z (10 months ago)
- Language: Swift
- Homepage:
- Size: 14.6 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TransitionPatch
## Sample
```
let value = ValuePatch(10)
.progress(start: 0, end: 13)
.clip(min: 0, max: 1)
.reverse()
.transition(start: 30, end: 60)
.value
// value == 36.92307692307692
```
## Functions
### Make a Progress
Make a value of progress from CGFloat between a range.
```swift
let progress: ProgressPatch = ValuePatch(10)
.progress(start: 5, end: 15)
// progress.fractionCompleted == 0.5
```
### Make a Transition from progress
Make a value of transition from progress between start and end.
```swift
let value: ValuePatch = ProgressPatch(0.5)
.transition(start: 10, end: 20)
// value.value == 15
```