I want convert the implementation to NSValue, but it's err.
In Objective-C, can use this line to convert:
[NSValue valueWithPointer:implementation]
but in Swift, how to convert?
As it says, it needs an UnsafePointer
, not a COpaquePointer
. So convert it:
let impValue = NSValue(pointer: UnsafePointer(imp))