Skip to content

xuzhr/CoreGeometry

 
 

Repository files navigation

CoreGeometry is a set of Core Graphics structs extensions and utility functions. It also offers a set of extensions and utility fonction for some Swift's numeric type.

Summary

Installation

dependencies: [
    // Dependencies declare other packages that this package depends on.
    .package(url: "https://gitlab.com/Pyroh/CoreGeometry.git", .upToNextMajor(from: "4.0.0")),
],

Numeric types additions

The ° operator

CoreGeometry adds a new postfixed operator ° to both IntegerLiteralType and FloatIntegerLiteral. What it does is to consider the literal as an angle expressed in degrees and convert it in radian.

As a result we can assert that :

45° == CGFloat.pi / 4
90.0° == CGFloat.pi / 2

It helps you to express angles in degree and pass them directly to CoreGraphics functions.

CGPoint additions

WIP

CGVector additions

WIP

CGRect additions

WIP

Contribute

WIP

License

See LICENSE

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%