对于新手的问题感到抱歉。似乎无法在Swift中使用CGRectIntegral和CGInsect函数
但只是要求标题暗示,我似乎无法使用这些函数在迅速3 ..我已经尝试导入CoreGraphics库,但没有vail。
任何人都知道为什么?
在此先感谢。
对于新手的问题感到抱歉。似乎无法在Swift中使用CGRectIntegral和CGInsect函数
但只是要求标题暗示,我似乎无法使用这些函数在迅速3 ..我已经尝试导入CoreGraphics库,但没有vail。
任何人都知道为什么?
在此先感谢。
其工作正常,但语法变化
let frame = CGRect.zero
let x = frame.integral
frame.insetBy(dx: 0, dy: 0)
谢谢你的回答。哦,好吧..我现在得到它..谢谢一堆! – user3608914
我还没有检查,但我想你可以像这样使用 attributes.frame = attributes.frame.integral –
其实你并不需要导入CoreGraphics中。
在夫特3 Objective-C的功能
CGRect CGRectIntegral(CGRect rect)
已成为
var integral: CGRect { get }
和
CGRect CGRectInset(CGRect rect, CGFloat dx, CGFloat dy);
已成为
func insetBy(dx: CGFloat, dy: CGFloat) -> CGRect
两个API已对CGRect
实例调用例如
let newFrame = view.frame.insetBy(dx: 10.0, dy:10.0)
一个提示,找出自己
非常感谢! – user3608914
进口CoreGraphics在
let rect = CGRect() let rectIntegral = rect.integral
谢谢:)
导入CoreGraphics后,它工作正常...我检查了xcode 8,swift 3 .. –