title: CGPathCreateCopyByTransformingPath to Swift 3
body: <p>I´m new to Swift 3 and I´m trying to translate the function to Swift 3:</p>
  
  <pre><code>- (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],                                                         &amp;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];
          }
      }
  }
  </code></pre>
  
  <p>I have made so far this but I have not bean able to translate this part:</p>
  
  <pre><code>    CGAffineTransform zoom = CGAffineTransformMakeScale(self.scale, self.scale);
  
      CGPathRef movedPath = CGPathCreateCopyByTransImformingPath([area.pathArea CGPath], &amp;zoom);
      area.pathAreaTransformed = [UIBezierPath bezierPathWithCGPath:movedPath];
  </code></pre>
  
  <p>I´m this:</p>
  
  <pre><code>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: &amp;zoom)
  
                  if let movedPath = movedPath {
                      area.pathAreaTransformed = UIBezierPath(cgPath: movedPath)
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I´m getting this error:</p>
  
  <blockquote>
    <p>Ambiguous reference to member 'copy(dashingWithPhase:lengths:transform
    :) '</p>
  </blockquote>
  
  <p>I have found nothing on the web but this:</p>
  
  <p><a href="https://developer.apple.com/reference/coregraphics/1411161-cgpathcreatecopybytransformingpa?language=objc" rel="nofollow noreferrer">https://developer.apple.com/reference/coregraphics/1411161-cgpathcreatecopybytransformingpa?language=objc</a></p>
  
  <p>But I can't make it work.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Happy coding.</p>