Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling a Function with NULL as Parameter

Tags:

swift

I am trying to load an image with the following Code, but I have no clue how to do this in Swift.

The CGImage Reference says, that I should pass NULL as parameter, but since NULL is not part of the Swift-Language this is not possible. Do I have to use UnsafePointer and if so, how?

var img = CGImageCreateWithPNGDataProvider(CGDataProviderCreateWithFilename("/Resources/image.png"),**?**, true,kCGRenderingIntentDefault)

Thanks in advance.

like image 280
user2390595 Avatar asked Feb 12 '23 19:02

user2390595


1 Answers

You should be able to pass nil for a null value.

like image 158
meda Avatar answered Feb 19 '23 07:02

meda