【问题标题】:How to use bezierPathWithCGPath Swift如何使用 bezierPathWithCGPath Swift
【发布时间】:2015-11-13 01:24:51
【问题描述】:

我需要制作贝塞尔路径,我有 CGPath 我找到的唯一信息是:

声明
斯威夫特

convenience init(CGPath CGPath: CGPath)

第一个是正常写的,第二个是斜体,第三个是开发者库中的紫色

我应该如何使用它?请举个例子。

【问题讨论】:

    标签: swift cgpath nsbezierpath


    【解决方案1】:

    如果您有一个有效的 CGPath,只需这样做:

    bezier_path = UIBezierPath(CGPath: your_cg_path)
    

    Objective-C 中的绝大多数 yWithX 类型方法在 Swift 中被替换为 init 方法。 This Apple documentation 有更多关于这个主题的信息。

    【讨论】:

      猜你喜欢
      • 2016-05-26
      • 2014-08-19
      • 2014-07-28
      • 1970-01-01
      • 2014-08-28
      • 2016-11-19
      • 1970-01-01
      • 1970-01-01
      • 2015-09-21
      相关资源
      最近更新 更多