美文网首页
swift这种参数怎么传

swift这种参数怎么传

作者: 陈藩 | 来源:发表于2022-02-16 08:40 被阅读0次

源代码:

public /*not inherited*/ init(roundedRect rect: CGRect, cornerWidth: CGFloat, cornerHeight: CGFloat, transform: UnsafePointer<CGAffineTransform>?)

传参数的代码:

 let path3 = CGPath.init(roundedRect: CGRect.init(x:100, y: 200, width: 200, height: 200), cornerWidth: 100, cornerHeight:100, transform:[CGAffineTransform(translationX:-100, y:100)])
    context.setFillColor(UIColor.red.cgColor)
    context.addPath(path3)
    context.fillPath()

相关文章

网友评论

      本文标题:swift这种参数怎么传

      本文链接:https://www.haomeiwen.com/subject/qjxllrtx.html