简体   繁体   中英

Objective-C to Swift bridge

I have to make use of an API which is written in Objective-C but my application uses Swift. I have heard of bridging concept, but I'm not very sure of how to implement it and make use of it in Swift. Is there any other way to make use of Objective-C in Swift?

Unfortunately, No.

You have to make use of bridge for it. Check this link (Apple)

Using bridging header is recommended way and pretty simple. xCode can even auto generate it for you. Follow the instructions here to see how you can implement it and make use of it - http://www.learnswiftonline.com/getting-started/adding-swift-bridging-header/

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