A host of utilities to make Swift Swiftier.
Rapid is a package containing many of the most common extensions to the standard library (and, occasionally, other frameworks).
Within Rapid, you will find:
- Operators for the most commonly used features, such as
§
to createString
representations - Unicode versions of built-in operators, such as
≠
instead of!=
- Property wrappers, such as
@Transformed
or@Clamped
- Global constants for commonly used values, such as
π
forDouble.pi
- Computed properties to simplify common comparisons, such as
isNil
orisNotEmpty
- Inverted versions of methods, such as
last(where:)
ornoneSatisfy(_:)
- Syntactic sugar for working on specific values, such as
configure(_:_:)
orrun(with:do:)
- Methods and subscripts that return
nil
instead of crashing when invalid arguments are passed - And more...
-
Add Rapid to your package manifest:
.package( url: "https://github.com/kaascevich/Rapid.git", branch: "main" )
-
Add Rapid as a dependency for each of your targets:
.product( name: "Rapid", package: "Rapid" )
- Choose File → Add Package Dependencies...
- Copy this link, and paste it into the search bar.
- Click Add Package.
- Choose the target you want to add Rapid to, and then click Add Package again.
I've documented everything to the best of my ability. However, due to an issue with the Swift Package Index, you'll need to build it yourself for now. Dunno when they fixed it, but they did! You can find it here.