/Drawing-App

Simple 2D drawing app with UIGraphics

Primary LanguageSwiftGNU General Public License v3.0GPL-3.0

Drawing-App

2D drawing app with UIGraphics -> UIKit -> Swift

Line class:

Including line object and it's properties, you can modify it as you want.

Line Options:
  • Color: UIColor
  • Width: CGFloat
  • Start: CGPoint
  • End: CGPoint
  • Cap: CGLineCap
  • Join: CGLineJoin
  • BlendMode: CGBlendMode

DrawingArea:

Extended from UIView class drawing lines with options, listening touches on screen and tracking the locations based on UIGraphics context. As default context using .interpolationQuality = .high

DrawingArea Options:

It is flexible, class you can modify it like normal UIView just added

  • isDrawable : Bool // For controlling drawing mode
  • Fill background: UIColor (tool)
  • Eraser (tool)
  • Color Picker (tool)
  • Undo (tool)
  • Clear (tool)