Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Graphics lib ios

Eonist edited this page Mar 20, 2017 · 16 revisions

Notes one graphics lib for iOS:

  • the truth is that you need a decorator style system to avoid too many concrete classes

  • just clean up v1 when porting to iOS

  • your new code that can reach protocol from shallow super type is cool

  • Decorator isn't too bad for value types as you can always copy vars to a new instance with less decoration if an instance gets too much decoration

Wants:

  • addSubView(Graphic())//draw on init

  • init colors via: .blue,.red,

  • init gradients via: .redBlue

  • init gradients via: NSColor.blue.to(.red)//gradient

  • init RectGraphic via: CGRect(0,0,100,100).graphic.fill(.red).stroke(.blue,10)

  • init CircGraphic via: CGEllipse(0,0,100,100).graphic

  • init RoundRectGraphic via: CGRect(0,0,100,100).graphic.fillet(20)

  • init PolyLineGraphic via: [CGPoint(0,0),CGPoint(50,50)].graphic.stroke(.redOrange,4)

  • init PathGraphic via: Path([.mt,.lt],[0,0,40,40]).graphic.stroke(.blue,10)

  • init DropShadow via: CGRect(100,100).fill(.orange).dropShadow()//Blue rect with default dropshadow applied

Clone this wiki locally