title: Swift 3 and CGContextDrawImage
body: <p>I want to translate this line to the Swift 3 current syntax code but seems there are some problems:</p>
  
  <pre><code>CGContextDrawImage(context, CGRect(x:0.0,y: 0.0,width: image!.size.width,height: image!.size.height), image!.cgImage)
  </code></pre>
  
  <p>According to the <a href="https://github.com/apple/swift/blob/master/apinotes/CoreGraphics.apinotes" rel="noreferrer">CoreGraphics.apinotes</a> <code>CGContextDrawImage</code> was converted to <code>CGContext.draw</code> :</p>
  
  <pre><code>Name: CGContextDrawImage
    # replaced by draw(_ image: CGImage, in rect: CGRect, byTiling: Bool = false)
    SwiftName: CGContext.__draw(self:in:image:)
    SwiftPrivate: true
  </code></pre>
  
  <p>When I try to do :</p>
  
  <pre><code> CGContext.draw(context as! CGImage, in: CGRect(x:0.0, y:0.0, width: image!.size.width, height: image!.size.height), byTiling: false) 
  </code></pre>
  
  <p>Seems there is some simple syntax that disturb the compiler but I cannot see (in fact I receive a typical ambiguous error):</p>
  
  <p><a href="https://i.stack.imgur.com/Hyznd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Hyznd.png" alt="enter image description here"></a></p>
  
  <p>Can anyone help me with this new swift 3 syntax code?</p>