Swift conversion: ERROR - CGPathAddArc

吃可爱长大的小学妹 提交于 2019-12-24 07:59:00

问题


I am attempting to convert my Swift 2 code into the latest syntax(Swift 3). I am receiving the following error:

Nil is not compatible with expected argument type 'UnsafePointer'

(Swift 2 Code)
CGPathAddArc(path, nil, overlayView.frame.width - radius/2 - xOffset, yOffset, radius, 0.0, 2 * 3.14, false)

Can someone please help me resolve this conversion syntax issue?


回答1:


    path.addArc(withCenter: CGPoint(x: overlayView.frame.width - radius/2 - xOffset, y: yOffset),
                radius: radius,
                startAngle: 0,
                endAngle: CGFloat(M_PI) * 2,
                clockwise: false)


来源:https://stackoverflow.com/questions/41403058/swift-conversion-error-cgpathaddarc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!