简体   繁体   中英

Calling objective c function from SWIFT through bridging header

I have ported an objective-c package into a swift package and included it within the bridging header. Everything works fine, except there is a function I have to implement from a delegate I can't get working:

- (void) mdwamp:(MDWamp*)wamp sessionEstablished:(NSDictionary*)info;

Does anyone know how I can implement this in SWIFT?

In the bridging header make sure you imported the objective-c header.

After doing that, you can use the following.

var instance: ClassName = ClassName()

instance.mdwamp(wamp, sessionEstablished: info)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM