Wednesday, November 28, 2018

iOS Objective C Bridging header

There are two ways to create an Objective-C Bridging Header. The first one is to create a new Objective-C File and specify that it is used a header file. This will then create two files: .h and .m or Just create the Header File on its own.

Click the Next button. You will be then asked to name this new file. You can name it whatever you like. I have named mine: Objective-CBridgingHeader. You will then be asked to chose a location for the filed to be saved. Usually Xcode will detect the correct folder but double check and then click save. You will then be presented with another Dialogue that says: Would you like to configure an Objective-C bridging header?:

Second option is to create objective C header separately

Go to File > New > File and Select Header File:
Just like the above example, Chose a name and save it. This will then create Just one file: Objective-CBridgingHeader.h

Now, depending on what ever example you have chosen open the .h file and add the following line:

#import

References:
https://www.ios-blog.com/tutorials/objective-c/how-to-create-an-objective-c-bridging-header/

No comments:

Post a Comment