mohammadalijf / StringToUIBezierPath

little extension i wrote to create UIBezierPath from String

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

String To UIBezierPath

create UIBezierPath from swift String

example

following code

let helloWorldString = "hello world!"
let path = helloWorldString.bezierPath(withFont: UIFont.systemFont(ofSize: 64))
let shapeLayer = CAShapeLayer(layer: holderView.layer)
shapeLayer.path = path.cgPath
shapeLayer.fillColor = fillColor
shapeLayer.strokeColor = lineColor
shapeLayer.lineWidth = 2
holderView.layer.addSublayer(shapeLayer)

results this

alt text

About

little extension i wrote to create UIBezierPath from String

License:MIT License


Languages

Language:Swift 100.0%