zumzum zumzum - 1 year ago 476
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?

Answer Source

This seems to work:

context.info = UnsafeMutablePointer(OpaquePointer(bitPattern: Unmanaged.passUnretained(self)))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download