Briefly describe how to refer to the OBJECT-C code in the SWIFT project, citing the Fscalendar project as an example
1. First create a headerfile under the directory you want to refer to
Click Next
Change the file name to ***-bridging-header, select the project name in targets, * * * Modify the required content, click Create
2. You can see the header file just created in the table of contents
The ***-bridging-header.h file in the image above is the newly created file, open it, and I'll open the file directly above it.
Fscalendar-bridging-header.h is the reference header file that I have created, as follows (it has only one row of differences from the * * * created)
You can see that the content is only 3 lines after the comment is dropped, add the OC file to be referenced before endif, where the example is #import "FSCalendar.h"
Don't forget to press Command+s to save when you have finished adding
3. Finally configure the bridge header file, click Target-buildsetting, Search in the search box bridging find objective-c bridging Header, modify its properties
Add the path to the file that you just created
It's done here, you can use the OC method in the project.