Skip to content

Generates a UIBezierPath approximation of an arithmetic spiral. Swift version of https://github.com/ZevEisenberg/ZESpiral

License

Notifications You must be signed in to change notification settings

ledzeppelin/UIBezierPath-Spiral

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UIBezierPath+Spiral

Generates a UIBezierPath approximation of an arithmetic spiral. Swift version of https://github.com/ZevEisenberg/ZESpiral

GitHub license

This is a swift conversion of ZESpiral which is used to generate arithmetic (“Archimedes”) spirals. It uses Bézier curve approximation to create a UIBezierPath of the form r = a + bθ.

Setup

Simply drag and drop the extension in your project.

Since the extension is implemented in Swift, if you are using Objective-C, you need to go to your target Build Settings and change Define Module to Yes. You can also choose a Product Module Name. Finally, import the module in your .m file:

#import "YourProductModuleName-Swift.h"

Example

let center = self.center
let startRad: CGFloat = 0
let space: CGFloat = 5
let starttheta: CGFloat = 0
let endtheta: CGFloat = 30
let thetastep: CGFloat = 1
YourLayer.path = UIBezierPath.getSpiralPath(center: center, startRadius: startRad, spacePerLoop: space, startTheta: starttheta, endTheta: endtheta, thetaStep: thetastep).cgPath

About

Generates a UIBezierPath approximation of an arithmetic spiral. Swift version of https://github.com/ZevEisenberg/ZESpiral

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%