当将一些 Cocoa 代码移动到 Cocoa Touch 时,我失望地发现 UIBezierPath 缺少“访问路径元素”方法:
– elementCount
– elementAtIndex:
– elementAtIndex:associatedPoints:
– removeAllPoints
– setAssociatedPoints:atIndex:
在 Cocoa Touch 中获取这些元素的唯一方法似乎是通过 CGPathApply
。在我尝试将其重新创建为 UIBezierPath 的子类或类别之前,我想知道这是否已经完成。有人知道这样的东西是否已经可用吗?
最佳答案
我在 https://github.com/seivan/UIBezierPathPort 上做了一个端口但它与 swift 有关。 有一个测试套件和文档。 从 Beta 5 开始工作。
从技术上讲,您应该能够在 Obj-C 项目中使用 Swift。
让我知道你喜欢它。
关于iphone - 使用 elementCount 和 elementAtIndex 使 UIBezierPath 更像 NSBezierPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6600558/