CGImageCreate is giving error in swift
<p>I'm trying to draw pixels of image into graphics context to iterate and print colorspace information values of an image. I've managed to buffer all the raw pixel values. But my attempts draw bitmap image using CGImageCreate have hit snag with the following error, also <a href="http://i.stack.imgur.com/u5OyG.png" rel="noreferrer">screenshot attached</a>. This is my code written.</p>

<pre><code>func createRGBAPixel(inImage: CGImageRef) -&gt; CGContextRef {
//Image width, height

let pixelWidth = CGImageGetWidth(inImage)
let pixelHeight = CGImageGetHeight(inImage)

//Declaring number of bytes 

let bytesPerRow = Int(pixelWidth) * 4
let byteCount = bytesPerRow * Int(pixelHeight)

//RGB color space

let colorSpace = CGColorSpaceCreateDeviceRGB()

//Allocating image data

let mapData = malloc(byteCount)
let mapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.PremultipliedFirst.rawValue)

//Create bitmap context

let context = CGBitmapContextCreate(mapData, pixelWidth, pixelHeight, Int(8), Int(bytesPerRow), colorSpace, mapInfo.rawValue)

let imageRef = CGBitmapContextCreateImage(context)


CGContextDrawImage(context, CGRectMake(0, 0, pixelWidth, pixelHeight), imageRef)


let data = CGDataProviderCopyData(CGImageGetDataProvider(imageRef)) as! NSData
let pixels = UnsafePointer&lt;UInt8&gt;(data.bytes)
var newPixelsArray = [UInt8](count: byteCount, repeatedValue: 0)
let provider = CGDataProviderCreateWithData(nil , &amp;newPixelsArray, data.length, nil)
let newImageRef = CGImageCreate(pixelWidth, pixelHeight, CGImageGetBitsPerComponent(imageRef), CGImageGetBitsPerPixel(imageRef), bytesPerRow, colorSpace, mapInfo, provider, nil, false, kCGRenderingIntentDefault)


return context!
</code></pre>

<p>CGImageCreate gives error at "kCGRenderingIntentDefault" saying "unresolved identifier". I have imported coreGraphics as well, it does not accept any value at this place. What can be suggested ? </p>

<p>Please help.</p>