pointers - Cast UnsafeMutablePointer<Void> to my struct type -
in swift code use peertalk objective-c library using bridging-header.
in delegate method payload in parameter type of unsafemutablepointer<void>
.
how can cast payload struct type in swift can use data?
just guess referencing here
struct yourstruct { var name : string } var structinstance = yourstruct.init(name: "jose") func delegatemethod(voidptr : unsafepointer<void>) { //conversion here let mystruct = unsafepointer<yourstruct>(voidptr).memory print("\(mystruct.name)") } delegatemethod(&structinstance)
Comments
Post a Comment