Yesterday, the icon in the project and the start of the transition picture is ready, so today, we can start slowly into the process of writing.
Because Swift is newer, so the class library is not perfect, but do not worry, Apple has already had a solution, that is, the use of bridging files, through the bridge file, the system will be the class library of the OC code into the swift language, so that there is no obstacle to use.
So how do you create a bridging file and how to call a class library? See below:
Create an OC. m file so that when you click on the next input file name and then select Store location after create, the system pops up the following options:
See here, of course to choose the latter, our goal is to create this bridge file! When you click Confirm, you can see two more files in the project:
Here, we need the. h file, it's already in our project, then you can delete the. m file you just created, and then you can make reference to the class library in this bridging file ....
Well, this is the creation of the bridge file, and the next time I'll write down in detail how to make a class library reference and Invoke ... and realize the map of Baidu map display and positioning function ...
Rewrite the company OC Project with Swift (DAY2)-Create a bridging file for OC and Swift, and call the OC Class Library