0
我有以下行創建弧端到端CGPoint()弧
func drawSomething(_ context: CGContext, rect: CGRect) {
context.saveGState()
let path = UIBezierPath()
let pathStartRagAngle = (0).degreesToRadians
let pathEndRagAngle = (220).degreesToRadians
path.addArc(withCenter: centerS, radius: rangeLabelsRect.size.width/2.0, startAngle: CGFloat(pathStartRagAngle), endAngle: CGFloat(pathEndRagAngle - 0.01), clockwise: true)
let color = UIColor.red
color.setStroke()
path.lineWidth = rangeLabelsWidth
path.stroke()
}
我想要做的就是添加圈結束的紅色弧形的,對於我需要CGPoint。所以可以找到辦法做到這一點,
你的問題有點不太清楚,你需要從用戶接觸的CGPoint轉換度數嗎? – Ammaiappan
@Ammaiappan我想要CGPoint,其中紅色圓弧接近 –
它可以幫助您的需求https://stackoverflow.com/a/9527985/529294 – Ammaiappan