我想绘制一些形状,如某人的签名或其他一些写意形状.我是UIBezierPath的新手.我尝试过以下代码,但它没有按我的意愿运行.
怎么可能呢?TIA
let path = UIBezierPath()
path.move(to: from)
path.addLine(to: to)
let shapeLayer = CAShapeLayer()
shapeLayer.path = path.cgPath
shapeLayer.strokeColor = lineColor.cgColor
shapeLayer.lineWidth = 1.0
view.layer.addSublayer(shapeLayer)
Run Code Online (Sandbox Code Playgroud) 完成块返回false值.我只是想打开www.google.com.这是我的代码.Xcode版本9.4.
UIApplication.shared.open(URL(string: "www.google.com")!, options: [ : ])
{ (success) in
debugPrint(success)
}
Run Code Online (Sandbox Code Playgroud)