iphone - 使用 elementCount 和 elementAtIndex 使 UIBezierPath 更像 NSBezierPath

标签 iphone ios cocoa-touch uibezierpath

当将一些 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/

相关文章:

iphone - 单击 UIActionSheet 中的按钮会导致我的应用程序崩溃

ios - 使用 PureLayout 自定义 UIButton

ios - 如何使 dataTaskWithRequest 在 swift(Xcode 9,swift 4)中按时间顺序排列?

ios - 从第三层导航 Controller 返回到原始 Root View Controller

ios - UISearchbar 中没有文本时返回

iphone - 如何以编程方式在 iPhone 上创建将同步到 iCal 的新日历

ios - 平滑用户体验的游戏 Assets 加载策略

iphone - NSURLConnection缓存和接收数据

UIWebView 中的 Javascript 回调到 C/Objective-C

ios - 通过 xcode 在 iphone 上测试应用程序替换了我的应用程序(从应用程序商店下载)