简体   繁体   中英

Can I use Objective-C library in xcode 6 using swift

我正在使用xcode 6,并且正在尝试实现swift语言,现在我想从github.com导入一些外部库,例如SDWebImage ,它使用Objectivc-C语言,因此我可以在使用swift语言的项目中使用它。

Yes it's possible. I highly recommend using cocoapods , a dependency manager which greatly simplify usage of external libraries.

Also read Swift and Objective-C in the Same Project as it explains how to use objc from swift.

Creating a bridging header under and add it under the project settings.

Include all the obj-c header you want to use in the bridging header and you are ready to go !

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