ios – CGPathCreateCopyByTransformingPath到Swift 3

ios – CGPathCreateCopyByTransformingPath到Swift 3,第1张

概述我是 Swift 3的新手,我正在尝试将该函数转换为Swift 3: - (void) drawRect: (CGRect)rect{ if (self.editionMode == Zoom) { for (Area *area in self.mArrayPaths) { CGAffineTransform zoom = CGAffineT 我是 Swift 3的新手,我正在尝试将该函数转换为Swift 3:

- (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所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1063001.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存