Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spacenation/swiftui-shapes
:rocket: Collection of SwiftUI shapes
https://github.com/spacenation/swiftui-shapes
apple ios macos shapes swift swift-library swift-package swiftui swiftui-example tvos watchos xcode
Last synced: 25 days ago
JSON representation
:rocket: Collection of SwiftUI shapes
- Host: GitHub
- URL: https://github.com/spacenation/swiftui-shapes
- Owner: spacenation
- License: mit
- Created: 2020-01-16T05:00:23.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-01T06:53:07.000Z (4 months ago)
- Last Synced: 2024-08-03T18:13:33.858Z (4 months ago)
- Topics: apple, ios, macos, shapes, swift, swift-library, swift-package, swiftui, swiftui-example, tvos, watchos, xcode
- Language: Swift
- Size: 630 KB
- Stars: 292
- Watchers: 3
- Forks: 24
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-swiftui-libraries - SwiftUI Shapes - Collection of SwiftUI shapes (Shapes / Content)
- stars - swiftui-shapes
- stars - swiftui-shapes
README
## SwiftUI Shapes
Collection of custom shapes## Regular Polygons
```swift
RegularPolygon(sides: 32)
RoundedRegularPolygon(sides: 6, radius: 20)
```## Lines and Curves
```swift
QuadCurve(unitPoints: [
UnitPoint(x: 0.1, y: 0.1),
UnitPoint(x: 0.5, y: 0.9),
UnitPoint(x: 0.9, y: 0.1)
])
.stroke(Color.blue, style: .init(lineWidth: 2, lineCap: .round))
.frame(height: 200)
```## Patterns
```swift
GridPattern(horizontalLines: 20, verticalLines: 40)
.stroke(Color.white.opacity(0.3), style: .init(lineWidth: 1, lineCap: .round))
.frame(height: 200)
.background(Color.blue)
.padding()
```## Install
Add `Shapes` to your project with Swift Package Manager```swift
// swift-tools-version:5.3
import PackageDescriptionlet package = Package(
name: "YOUR_PROJECT",
dependencies: [
.package(url: "https://github.com/spacenation/swiftui-shapes.git", from: "1.1.0"),
]
)
```## Code Contributions
Feel free to contribute via fork/pull request to master branch. If you want to request a feature or report a bug please start a new issue.