我希望用户触摸2个点,然后在这两个点之间绘制一条线.这是我到目前为止:
func drawline(){
let context = UIGraphicsGetCurrentContext()
context!.beginPath()
context?.move(to: pointA)
context?.addLine(to: pointB)
context!.strokePath()
}
Run Code Online (Sandbox Code Playgroud)
pointA是用户触及的第一点,pointB也是第二点.我收到错误:
thread 1:EXC_BREAKPOINT
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助.