Collection of SwiftUI shapes

Overview

SwiftUI Shapes

Collection of custom shapes

Regular Polygons

RegularPolygon(sides: 32)
RoundedRegularPolygon(sides: 6, radius: 20)

Lines and Curves

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

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-tools-version:5.3
import PackageDescription

let 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.

You might also like...
SwiftUI Image loading and Animation framework powered by SDWebImage
SwiftUI Image loading and Animation framework powered by SDWebImage

SDWebImageSwiftUI What's for SDWebImageSwiftUI is a SwiftUI image loading framework, which based on SDWebImage. It brings all your favorite features f

AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.

URLImage URLImage is a SwiftUI view that displays an image downloaded from provided URL. URLImage manages downloading remote image and caching it loca

A pure Swift high-performance asynchronous image loading framework. SwiftUI supported.
A pure Swift high-performance asynchronous image loading framework. SwiftUI supported.

Longinus Longinus is a pure-Swift high-performance asynchronous web image loading,caching,editing framework. It was learned from Objective-C web image

Lightweight and customisable async image loading in SwiftUI. Supports on-disk storage, placeholders and more!
Lightweight and customisable async image loading in SwiftUI. Supports on-disk storage, placeholders and more!

Asyncrounously download and display images in Swift UI. Supports progress indicators, placeholders and image transitions. RemoteImageView Asyncrounous

🖼 Gallery App for Actomaton (async/await + Elm Architecture) + SwiftUI.
🖼 Gallery App for Actomaton (async/await + Elm Architecture) + SwiftUI.

🖼 Actomaton-Gallery Gallery App for Actomaton (async/await + Elm Architecture) + SwiftUI. NOTE: Most of the code are reused from Harvest-SwiftUI-Gall

GIFImage component for your SwiftUI app!
GIFImage component for your SwiftUI app!

SwiftUI GIF Lightweight SwiftUI component for rendering GIFs from data or assets, with no external dependencies. As a bonus, there's an extension that

PrettyBorder is a SwiftUI package for managing an customized border and background at any kind of view.
PrettyBorder is a SwiftUI package for managing an customized border and background at any kind of view.

PrettyBorder Description PrettyBorder is a SwiftUI package for managing an customized border and background at any kind of view. Preview of end result

A SwiftUI view for displaying image histograms
A SwiftUI view for displaying image histograms

HistogramView A SwiftUI view for displaying image histograms. How do I use it? It's as simple as: HistogramView(image: myImage) Note: Both UIImage & N

Fun GridScrollView written in SwiftUI + Combine, bridging between UIKit
Fun GridScrollView written in SwiftUI + Combine, bridging between UIKit

BSZoomGridScrollView BSZoomGridScrollView is a powerful, pure swift iOS UI framework that provides the awesome grid scrollview containing your image a

Comments
  • Curved Regular Polygons

    Curved Regular Polygons

    Added 'radius:' to all the regular polygons to make it so we can have curved corners.

    I made these changes for my own purposes, so it may not fit everyone's needs, but it does work and is as simple as I could make it, so I believe it should do the job for most uses. There is one missing functionality that needs to be added before I would call it a completed update.

    What it will do:

    • Allow you to make any regular polygon have curved sides, I updated not only the base regular polygon code, but also the 'pre-made' shapes like Hexagon() and the others.

    What it won't do currently:

    • It won't, as of yet, have the inner line of the shapes be curved when using '.stroke()' or '.strokeBorder()'. I didn't need this functionality, so I haven't put any thought into how to go about this yet, but I imagine it won't be too hard to update.

    A Note: I only began to teach myself to program in December of 2019 and then I took a break from March/April till November, so I may not have done everything perfectly and am definitely open to feedback.

    opened by ToddGeorgeKelly 1
Releases(2.0.0-beta.1)
Owner
SpaceNation
Software development team
SpaceNation
ZImageCropper is a simplest way to crop image to any shapes you like.

ZImageCropper ZImageCropper is a simplest way to crop image to any shapes you like. Example To run the example project, clone the repo, and run pod in

Mohammad Zaid Pathan 219 Dec 17, 2022
DTPhotoViewerController - A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.

DTPhotoViewerController Example Demo video: https://youtu.be/aTLx4M4zsKk DTPhotoViewerController is very simple to use, if you want to display only on

Tung Vo 277 Dec 17, 2022
Drop in GIF Collection View. Uses Tenor as default GIFs provider.

Drop in GIF Collection View. Uses Tenor as default GIFs provider. This will allow you to easily integrate GIF image search into your app or you can use this as a GIF keyboard for your messaging needs.

null 5 May 7, 2022
The collection of image filters with swift

SemanticImage The collection of image filters. How to use Setting Up 1, Add Sema

MLBoy 60 Dec 29, 2022
A Swift/SwiftUI utility for caching and displaying images in SwiftUI Views

A Swift/SwiftUI utility for caching and displaying images asynchronously. Built with Swift 5.5 and works with async/await.

王雪铮 Xuezheng Wang 1 May 5, 2022
🚀SwiftUI Image downloader with performant LRU mem/disk cache.

Progressive concurrent image downloader for SwiftUI, with neat API and performant LRU mem/disk cache.

Cheng Zhang 42 Sep 24, 2022
Lazy image loading for SwiftUI

A missing piece in SwiftUI that provides lazy image loading.

Alexander Grebenyuk 9 Dec 26, 2022
AsyncImageExample An example project for AsyncImage. Loading images in SwiftUI article.

AsyncImageExample An example project for AsyncImage. Loading images in SwiftUI article. Note: The project works in Xcode 13.0 beta (13A5154h).

Artem Novichkov 4 Dec 31, 2021
This package integrates a UIImagePickerController into a SwiftUI app.

This Swift Package integrates a UIImagePickerController into a SwiftUI app and allows a user to select, scale and position an image to be cropped and saved as a conatct's photo, similar to the stock iOS Contacts app.

Rillieux 58 Dec 26, 2022
Backport of SwiftUI.AsyncImage to iOS 14, macOS 11, tvOS 14 and watchOS 7 and earlier.

SBPAsyncImage Backport of SwiftUI.AsyncImage to iOS 14, macOS 11, tvOS 14 and watchOS 7 and earlier. AsyncImage is a view that asynchronously loads an

Yutaro Muta 48 Dec 16, 2022