- (voID) drawRect: (CGRect)rect{ if (self.editionMode == Zoom) { for (Area *area in self.mArrayPaths) { CGAffinetransform zoom = CGAffinetransformMakeScale(self.scale,self.scale); CGPathref movedpath = CGPathCreatecopyBytransformingPath([area.pathArea CGPath],&zoom); area.pathAreatransformed = [UIBezIErPath bezIErPathWithCGPath:movedpath]; [area.fillcolor setFill]; [area.strokecolor setstroke]; [area.pathAreatransformed fill]; [area.pathAreatransformed stroke]; } } else if (self.editionMode == MoveShapes) { [self.currentArea.fillcolor setFill]; [self.currentArea.pathAreaShift fill]; [self.currentArea.pathAreaShift stroke]; for (Area *area in self.mArrayPaths) { if (area == self.currentArea) { continue; } [area.fillcolor setFill]; [area.strokecolor setstroke]; [area.pathArea fill]; [area.pathArea stroke]; } } else { [self.currentArea.fillcolor setFill]; [self.currentArea.pathArea fill]; [self.currentArea.pathArea stroke]; for (Area *area in self.mArrayPaths) { [area.fillcolor setFill]; [area.strokecolor setstroke]; [area.pathArea fill]; [area.pathArea stroke]; } }}
到目前为止我已经做了这个,但我没有能够翻译这部分:
CGAffinetransform zoom = CGAffinetransformMakeScale(self.scale,self.scale); CGPathref movedpath = CGPathCreatecopyByTransImformingPath([area.pathArea CGPath],&zoom); area.pathAreatransformed = [UIBezIErPath bezIErPathWithCGPath:movedpath];
我是这样的:
overrIDe func draw(_ rect: CGRect) { if self.editionMode == EditionMode.Zoom { for area in self.mArrayPaths { if let area = area as? Area { var zoom: CGAffinetransform = CGAffinetransform.init(scaleX: self.scale,y: self.scale) var movedpath = CGPath.copy(using: &zoom) if let movedpath = movedpath { area.pathAreatransformed = UIBezIErPath(cgPath: movedpath) } } } }}
我收到此错误:
Ambiguous reference to member ‘copy(dashingWithPhase:lengths:transform
总结以上是内存溢出为你收集整理的ios – CGPathCreateCopyByTransformingPath到Swift 3全部内容,希望文章能够帮你解决ios – CGPathCreateCopyByTransformingPath到Swift 3所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)