Just trying to use:
var context = CGBitmapContextCreate(nil, self.bounds.width as UInt, self.bounds.height as UInt, 8, nil, CGColorSpaceCreateDeviceRGB(), kCGBitmapByteOrder32Big)
But he says kCGBitmapByteOrder32Big is an unresolved identifier. But I found many examples like this in stackoverflow, but for objectC. Q: How to start / get CGBitmapInfo
The correct syntax is:
var context:CGContextRef = CGBitmapContextCreate(nil, UInt(self.bounds.width), UInt(self.bounds.height), 8, 0, CGColorSpaceCreateDeviceRGB(), CGBitmapInfo.ByteOrder32Big)
source share