Coder Social home page Coder Social logo

swiftui-shapes's Introduction

SwiftUI Swift 5.1 Swift 5.1 kieranb662 followers

Commonly used shapes for SwiftUI, some I found on the web swiftui-lab and objc.io, others I made myself. I hope to create community based repo for cool animated shapes, paths, etc. If you would like to submit some of your own shapes just make a pull request and I will try to approve it ASAP. If you want to try out this package just clone the example project

Or create your own shapes using the bez editor app available for free on iOS 13.4 and greater.

  • AnyShape: A type erased Shape

  • Lines

    • Line
    • HorizontalLine
    • VerticalLine
    • AdaptiveLine
  • Triangles

    • Triangle
    • OpenTriangle
    • RightTriangle
  • Graphing

    • CartesianGrid
    • TickMarks
    • PolarGrid
    • RadialTickMarks
  • Misc

    • InfinitySymbol
    • Arrow
    • Polygon
    • Pentagon
    • PathText
    • FoldableShape

Lines

Line

Found at drawing trees. A Line defined by the from and to points.

Horizontal

A horizontal line that is the width of its container has a single parameter offset: A value between 0 and 1 defining the lines vertical offset in its container (Default: 0.5)

Vertical

A Vertical line that is the height of its container has a single parameter offset: A value between 0 and 1 defining the line's horizontal offset in its container (Default: 0.5)

Adaptive

This shape creates a line centered inside of and constrained by its bounding box. The end points of the line are the points of intersection of an infinitely long angled line and the container rectangle

Triangles

The various triangles are shown below.

Graphing

Cartesian Grid

A Rectangular grid of vertical and horizontal lines. Has two parameters xCount: The number of vertical lines yCount: The number of horizontal lines

Polar Grid

A grid made up of concentric circles and angled lines running through their center. rCount: The number of Circles thetaCount: The number of lines

TickMarks

Tick marks spaced out evenly with varying lengths dependent on the type of tick minor, semi, or major.

The shape has two parameters spacing: CGFloat and ticks: Int. The spacing is the distance between ticks while the ticks is the number of tick marks.

An examples using TickMarks are shown below

Misc

Arrow

An arrow that starts out small shaped like this |--| but as it grows larger it looks like this <---->

Pentagon

Foldable Shapes

Contributing

If you have an idea for a shape but don't know how to describe it, try out the PathEditor tool that comes packaged with bez

swiftui-shapes's People

Contributors

kieranb662 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

swiftui-shapes's Issues

Credentials issue when adding this package

Hi, I found your excellent work on Sliders and then Shapes but am not able to add the package into Xcode due to credentials issue. Do you have time to take a look at this? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.