I am making a basic drawing app and using the following tutorial to allow the user to draw:
Is there anyway to smoothen out these curves using this approach?
CodePudding user response:
You're currently creating a new line segment for every point.
What you likely want to do is move To: the first point, and then addLine: To the successive points:
private func add(drawing: Drawing, toPath path: inout Path) {
let points = drawing.points
if points.count > 1 {
path.move(to: points[0])
for i in 1..<points.count-1 {
path.addLine(to: points[i])
}
}
}

