Swift “Bridging-Header.h” file not allowing me to instantiate objective-c classes in .swift files

后端 未结 5 1510
执笔经年
执笔经年 2020-12-05 03:10

When X-code tries to create a bridging header automatically, it crashes every single time, so I followed the instructions on how to manually create a bridging header. (Creat

5条回答
  •  时光取名叫无心
    2020-12-05 03:46

    1. Add a header file to your project with the name "[your-project-name]-Bridging-Header.h

    1. Go to Build Settings > Build Options and set "Embedded Content Contains Swift Code" to "Yes"

    2. Go to Build Settings > Linking and add "@executable_path/Frameworks" to Runpath Search Paths

    Build your project now!

提交回复
热议问题