Swiftpack.co - muukii/TransitionPatch as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by muukii.
muukii/TransitionPatch 1.0.3
Declarative sequence for converting value.
⭐️ 3
🕓 1 week ago
iOS
.package(url: "https://github.com/muukii/TransitionPatch.git", from: "1.0.3")

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.

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.

let value: ValuePatch = ProgressPatch(0.5)
  .transition(start: 10, end: 20)

// value.value == 15

GitHub

link
Stars: 3
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Support SwiftPM
1 year ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics