Swiftpack.co - kieranb662/SwiftUI-bez as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kieranb662.
kieranb662/SwiftUI-bez 1.0.8
Utilities for working with bezier curves in SwiftUI
⭐️ 93
🕓 3 years ago
iOS macOS watchOS
.package(url: "https://github.com/kieranb662/SwiftUI-bez.git", from: "1.0.8")

SwiftUI Swift 5.1 Swift 5.1 kieranb662 followers

Bez is a swift package aimed at making Bézier curves easy to work with and manipulate.

Try out all that bez has to offer by creating your own shapes using the bez editor app available for free on iOS 13.4 and greater.

The various utilities included are:

  • Interpolation Functions
  • Derivatives
  • Arc Lengths
  • Segmentation
  • Subdivision
  • Lookup Table Generation
  • Path Description -> Normalized SwiftUI Shape Conversion

Quick Start

  1. Snag that URL from the github repo
  2. In Xcode -> File -> Swift Packages -> Add Package Dependencies
  3. Paste the URL Into the box
  4. Specify the minimum version number (1.0.5)
  5. Copy/Paste the following snippet Into The ContentView.swift file
import SwiftUI
import bez

struct ContentView: View {
    @ObservedObject var polybezier: PolyBezier = PolyBezier(Circle().path(in: .init(x: 50, y: 100, width: 100, height: 100)))
    var body: some View {
        NavigationView {
            PathEditor(polybezier: _polybezier, name: "Shape",
                save:  { (name , path) in print(path)})
                .navigationBarTitle("Bez Editor", displayMode: .inline)
            
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView().colorScheme(.dark)
    }
}

Mathematical Background

bez Info

Example Uses

The PSlider component of the Sliders SwiftUI Library

Path Slider Gif

GitHub

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

Dependencies

Release Notes

Fixed package platforms
3 years ago

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