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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -