Swiftpack.co - reuschj/StrokedShape as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by reuschj.
reuschj/StrokedShape v1.0.3
A SwiftUI convenience wrapper to allow you to set both a foreground color and stroke for a shape.
⭐️ 1
🕓 2 years ago
.package(url: "https://github.com/reuschj/StrokedShape.git", from: "v1.0.3")

StrokedShape

SwiftUI allows a Shape to have either a foreground color added or a stroke, but not both. The solution is easy, but somewhat cumbersome: give the shape a foreground color, then overlay an identical shape with a stroke.

This is a package to reduce this boilerplate of giving a shape both a foreground color and stroke.

StrokedShape(
    foreground: .blue,
    outlineColor: .black,
    outlineWidth: 1
) {
    Circle()
}

GitHub

link
Stars: 1
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

WatchOS Compatible
2 years ago
  • WatchOS compatiblity

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