Import Objective-c framework into Swift framework project

后端 未结 3 371
故里飘歌
故里飘歌 2020-12-30 05:03

I am building a framework in which I need to import some objective-c frameworks for now I need to import \"Beaconstac.framework\" but as we can not add a bridging header in

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-30 05:42

    Create a file called module.modulemap and include the following contents:

    module ObjCFrameworkName {
        header "ObjCFrameworkName.framework/Headers/ObjCFrameworkNameUmbrellaHeader.h"
        export *
    }
    

    Be aware that you need to have the correct path to your Obj-C framework's umbrella header which may differ slightly with what's listed in the example above.

    If you are still stuck, I would strongly suggest taking a look at this project.

提交回复
热议问题