Swift Bridging Header and visibility of Obj-C class

前端 未结 2 2012
天涯浪人
天涯浪人 2021-01-12 14:47

I\'ve aded bridging header, specified in build settings the full path to it, bridging header was created automatically. After this, i\'ve included my obj-c header files in i

2条回答
  •  被撕碎了的回忆
    2021-01-12 14:57

    Well, after creating a test project with bridging header, I found out the following:

    1. I added .m file, Xcode proposed me to create bridging header.

    2. I added .h file, named it as class and created Obj-C class in this way.

    AND:

    In build settings - code generation section looks like this:

    enter image description here

    Bridging file located at the following path:

    ProjName / BridgHeader.h

    At the same level as .xcodeproj file exists.

    BUT:

    When I added already created Obj-C class to project and added header import in bridging header, I couldn't use it:

    enter image description here

    So, I guess, Xcode 6 beta 2 cannot add existing files to swift project. Did anyone face this trouble? Cause I don't want to paste all existing libraries, that I was developing for 5 years to created files.

    P.S:

    Bridging header:

    enter image description here

提交回复
热议问题