How to use Objective-C CocoaPods in a Swift Project

后端 未结 4 1609
余生分开走
余生分开走 2020-11-29 17:13

Is there a way I can use a CocoaPod written in Objective-C in my Swift project using swift?

Do I just make a bridging header? And if so, can I access the objects, cl

4条回答
  •  臣服心动
    2020-11-29 18:18

    In podFile use the flag use_frameworks! Inside Xcode in the Pod folder structure in the dependency, you add xxxxxxx-umbrella.h in Support Files.

    In your {PROJECT_NAME}-Bridging-Header.h use:

    #import "xxxxxxx/xxxxxxx-umbrella.h"
    

    It works for me.

提交回复
热议问题