How to import a Swift framework globally?

后端 未结 6 951
情歌与酒
情歌与酒 2020-12-14 05:56

I want to have a way to import my Swift Cocoapods globally in every class, how can I achieve this?

I tried a lot of things and they didn\'t work. Here are some ways

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-14 06:56

    As of Swift4:

    • Being in a Swift project
    • Want to have another Swift project globally imported (and using cocoapods)

    I just managed to do that by adding the following line to my bridging header:

    #import 
    

    How good/bad this practise is? Not sure, but I just wanted some extensions globally available in my project. this did the trick.

提交回复
热议问题