5

I have the following code:

let ref:CGContextRef = CGBitmapContextCreate(nil , 200, 130, CGImageGetBitsPerComponent(self.CGImage), 0, CGImageGetColorSpace(self.CGImage), CGImageGetBitmapInfo(self.CGImage))

The problem is that I get this error:

Expression does not conform to type 'NilLieralConvertible'

What should I pass in instead of nil for the first argument and why?

David H
  • 40,852
  • 12
  • 92
  • 138
zumzum
  • 17,984
  • 26
  • 111
  • 172

1 Answers1

12

The problem is the last argument. Make the last argument CGImageGetBitmapInfo(self.CGImage).rawValue.

matt
  • 515,959
  • 87
  • 875
  • 1,141