1. CGPathMoveToPoint'不可用:使用move(to:transform :) 2.'CGPathAddLineToPoint'不可用:使用addLine(to:transform :) [英] 1. CGPathMoveToPoint' is unavailable: Use move(to:transform:) 2. 'CGPathAddLineToPoint' is unavailable: Use addLine(to:transform:)
本文介绍了1. CGPathMoveToPoint'不可用:使用move(to:transform :) 2.'CGPathAddLineToPoint'不可用:使用addLine(to:transform :)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Xcode 7.3.1
的swift 2
中创建了我的一个应用程序.但是现在我在Xcode 8.0
中打开了相同的应用程序并执行更改.我进行了一些自动更改,并显示了一些错误和建议,他们已对其进行了更正.但是我面临的问题是
I have created one of my application in swift 2
in Xcode 7.3.1
. But now I have open same application in Xcode 8.0
and perform changes. Some automatic changes are done and some errors and suggestions shown I have corrected them. But I am facing issue that
let path = CGMutablePath()
CGPathMoveToPoint(path, nil, lineFrame.midX, lineFrame.midY)
CGPathAddLineToPoint(path, nil, lineFrame.origin.x + lineFrame.width / 2, lineFrame.origin.y)
我尝试创建path
,但显示错误
I tried to create path
, but shows error that
-
CGPathMoveToPoint
不可用:使用move(to:transform:) -
CGPathAddLineToPoint
不可用:使用addLine(to:transform:)
CGPathMoveToPoint
is unavailable: Use move(to:transform:)CGPathAddLineToPoint
is unavailable: Use addLine(to:transform:)
如果有人有解决方案,请让我知道.
If anyone have solution, please let me know.
推荐答案
尝试一下:
let path = CGMutablePath()
path.move(to: CGPoint(x: lineFrame.midX, y: lineFrame.midY))
path.addLine(to: CGPoint(x: lineFrame.origin.x + lineFrame.width / 2, y: lineFrame.origin.y))
并检查CGMutablePath
的最新参考文献:
And check the latest reference of CGMutablePath
:
这篇关于1. CGPathMoveToPoint'不可用:使用move(to:transform :) 2.'CGPathAddLineToPoint'不可用:使用addLine(to:transform :)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文