Spiral is a SwiftUI shape for macOS, iOS and watchOS.

Overview

cover3

Spiral is a SwiftUI shape for macOS, iOS and watchOS.

A spiral is a component that includes a point generator, Shape and View of the spiral. The point generator allows direct data to be used for particularly rare cases. The Shape and View of the spiral is designed for SwiftUI. The Spiral shape can be outlined or filled with the desired material. The `SpiralView' allows you to place arbitrary views at spiral points.

Requirements

  • Swift 5.5+
  • Xcode 13+
  • SwiftUI 2+
  • macOS 11+
  • iOS 14+
  • watchOS 7+

Some of the requirements could be reduced if there is a demand for them.

Installation

  1. In Xcode go to FileAdd Packages...
  2. Search for the link below and click Add Package
https://github.com/buh/Spiral.git
  1. Select to which target you want to add it and select Add Package

Preview

Spiral1.mov
Spiral2.mov

circle

text

chart1

chart2

Usage Example

chart2

Usage

Spiral Shape

It has several parameters:

  • pathType: the type of path you want to draw.
  • startAt: the start angle of a spiral.
  • endAt: the end angle of a spiral.
  • smoothness: the point density which describes a spiral.
  • offsetRadius: spiral radius offset for each point with respect to the calculated angle and frame.
  • offsetAngle: angle offset of each spiral point with respect to the calculated angle and frame.

image

var body: some View {
    Spiral(
        startAt: .degrees(90),
        endAt: .degrees(360)
    )
    .stroke(
        Color.blue,
        style: .init(lineWidth: 20, lineCap: .round, lineJoin: .round)
    )
}

Spiral View

When usingSpiralView, you need to position the content based on the spiral point coordinates.

var body: some View {
    SpiralView(
        startAt: .degrees(90),
        endAt: .degrees(360)
    ) { index, spiralPoint in
        Text("Hello")
            .position(x: spiralPoint.point.x, y: spiralPoint.point.y)
    }
}

Documentation

You can find the generated DocC documentation here.

Demo App

You can play with all the parameters in the demo app, which can be run on macOS, iPad, iPhone.

The app heavily uses the CompactSlider, which you can find out more about here.

Support

You can buy me a coffee here ☕️

License

Spiral is available under the MIT license

You might also like...
Mobile-ios-ml - SBB Mobile Machine Learning for iOS devices
Mobile-ios-ml - SBB Mobile Machine Learning for iOS devices

ESTA library: Machine Learning for iOS This framework simplifies the integration

Matft is Numpy-like library in Swift. Function name and usage is similar to Numpy.
Matft is Numpy-like library in Swift. Function name and usage is similar to Numpy.

Numpy-like library in swift. (Multi-dimensional Array, ndarray, matrix and vector library)

Realtime yoga pose detection and classification plugin for Flutter using MLKit

ML Kit Pose Detection Plugin Flutter plugin for realtime pose detection using MLKit's Blazepose. License Copyright (c) 2021 Souvik Biswas, Bharat Bira

Sample code for Core ML using ResNet50 provided by Apple and a custom model generated by coremltools.
Sample code for Core ML using ResNet50 provided by Apple and a custom model generated by coremltools.

CoreML-samples This is the sample code for Core ML using ResNet50 provided by Apple. ResNet50 can categorize the input image to 1000 pre-trained categ

A Swift deep learning library with Accelerate and Metal support.
A Swift deep learning library with Accelerate and Metal support.

Serrano Aiming to offering popular and cutting edge techs in deep learning area on iOS devices, Serrano is developed as a tool for developers & resear

A Swift library for creating and exporting CoreML Models in Swift

SwiftCoreMLTools A Swift Library for creating CoreML models in Swift. Work in progress This library expose a (function builder based) DSL as well as a

DL4S provides a high-level API for many accelerated operations common in neural networks and deep learning.
DL4S provides a high-level API for many accelerated operations common in neural networks and deep learning.

DL4S provides a high-level API for many accelerated operations common in neural networks and deep learning. It furthermore has automatic differentiati

Takes those cursed usernames you see on social networks and lets them be accessible to screen readers.
Takes those cursed usernames you see on social networks and lets them be accessible to screen readers.

AccessibleAuthorLabel 🔖 Takes those cursed usernames you see on social networks and lets them be accessible to screen readers so everyone can partake

WhatPet - A basic app that classifies images of dogs, cats and rabbits using CoreML
WhatPet - A basic app that classifies images of dogs, cats and rabbits using CoreML

WhatPet ✓ A basic app that classifies images of dogs, cats and rabbits using Cor

Releases(1.0.1)
Owner
Alexey Bukhtin
iOS/macOS developer
Alexey Bukhtin
Accelerated tensor operations and dynamic neural networks based on reverse mode automatic differentiation for every device that can run Swift - from watchOS to Linux

DL4S provides a high-level API for many accelerated operations common in neural networks and deep learning. It furthermore has automatic differentiati

Palle 87 Dec 29, 2022
A note on the Construction of the watchOS App Notes

This document is a note on the Construction of the watchOS App "Notes" Learn about the main topics of this watchOS project In this SwiftUI tutorial, w

Daniel Beatty 0 Dec 6, 2021
Slot-machine - SwiftUI - iOS App Slot Machine game

Slot Machine SwiftUI Masterclass project iPhone, iPad and Mac (with Catalyst framework) Complex interface Extensions and custom View Modifiers Input t

Arthur Neves 1 Sep 12, 2022
Coffee App Splash Screen made with SwiftUI.

SplashScreen-CoffeeApp Coffee App Splash Screen made with SwiftUI. SplashScreen - Code struct ContentView: View { @State var splashScreen = true

Shreyas Bhike 18 Oct 2, 2022
C-19-StatusSwiftUI - Covid-19 Status App made with SwiftUI

C-19-StatusSwiftUI C-19 Status App made with SwiftUI . First Creator of App - th

Shreyas Bhike 5 Feb 22, 2022
A powerful SwiftUI Architecture that merges Redux to the functional world of Swift. While bringing powerful workflows to streamline CoreML/Metal/IPFS usage in the Apple ecosystem.

GraniteUI - v0.0 - WIP A powerful SwiftUI Architecture that merges Redux event handling and state management with functional programming. While bringi

Kala 2 Dec 22, 2022
MarinersCompassSwiftUI - MarinersCompass Animation made with SwiftUI

MarinersCompassSwiftUI MarinersCompass Animation made with SwiftUI.

Shreyas Bhike 22 Nov 12, 2022
RainbowGaugeSwiftUI - Rainbow Gauge made with SwiftUI

RainbowGaugeSwiftUI Rainbow Gauge made with SwiftUI.

Shreyas Bhike 10 Jan 6, 2023
Artificial intelligence/machine learning data structures and Swift algorithms for future iOS development. bayes theorem, neural networks, and more AI.

Swift Brain The first neural network / machine learning library written in Swift. This is a project for AI algorithms in Swift for iOS and OS X develo

Vishal 331 Oct 14, 2022
Resource monitor - A flutter plugin for Android and IOS to monitor CPU and RAM usage of device.

resource_monitor A flutter plugin for Android and IOS to monitor CPU and RAM usage of device. TODO Implement Android Side of this plugin. Add listener

Skandar Munir 1 Nov 11, 2022