Skip to content

Instantly share code, notes, and snippets.

@daoseng33
Created August 13, 2018 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daoseng33/2c8c2352802c9e9fb16303e2f8695b1c to your computer and use it in GitHub Desktop.
Save daoseng33/2c8c2352802c9e9fb16303e2f8695b1c to your computer and use it in GitHub Desktop.
// Draw dotted line
let viewBorder = CAShapeLayer()
viewBorder.lineDashPattern = [2, 2]
viewBorder.frame = myView.bounds
viewBorder.fillColor = nil
viewBorder.path = UIBezierPath(rect: myView.bounds).cgPath
myView.layer.addSublayer(viewBorder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment