Skip to content

A (really) simple Swift 4 UIView class with a triangle and a diagonal line rendered and customizable in the storyboard (color, line width, direction)

License

Notifications You must be signed in to change notification settings

matvdg/Triangle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Triangle and DiagonalLine

Two (really) simple Swift 4 UIView classes with a triangle and a diagonal line rendered and customizable in the storyboard (color, line width, direction)

Triangle: UIView and DiagonalLine: UIView are @IBDesignable classes so that they are rendered in your storyboard, and all their properties are @IBInspectable so that you can customize your triangle and diagonal view inside the storyboard in the Attributes inspector.

Quick install:

  • Just drag these classes into your project

  • In your storyboard, select a UIView

  • Go the the identity inspector and in the class field, type Triangle or DiagonalView instead of UIView

  • Play with the attributes inspector with real-times results!

    • Triangle: pick a fill color
    • Diagonal: pick a color for your line
    • Triangle: choose the three points x and y positions (0 to 1) to create any triangle you want!
    • Diagonal: choose the direction (flip)
    • Diagonal: specify the line width

Image of Triangle Image of Diagonal View

About

A (really) simple Swift 4 UIView class with a triangle and a diagonal line rendered and customizable in the storyboard (color, line width, direction)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages