zumzum zumzum - 1 month ago 31
iOS Question

Unmanaged.passUnretained(self).toOpaque() to Swift 3

I have the following error:

enter image description here

the line of code in the image is this:

context.info = UnsafeMutablePointer(Unmanaged.passUnretained(self).toOpaque())

I am not sure how to fix this. I did look into this:


but, I am not sure how to properly fix the error.

Any help?


This seems to work:

context.info = UnsafeMutablePointer(OpaquePointer(bitPattern: Unmanaged.passUnretained(self)))