Swift comes out more popular, but there are many third-party libraries that do not support swift, and individuals feel that Swift still has a long way to go.
And recently, even Swift's founders have left Apple ....
Join Swift for third-party things what to do, it is very simple, Xcode will automatically help you to create a bridging file to connect the two languages of Swift and OC, the same in OC with Swift also.
Actually the steps are the same,
First: Connect OC in Swift
Steps:
In the new OC class, to the last Xcode will automatically prompt to create a swift and OC link file, click Create, then you will find a project in the beginning of a header file, the use of the OC class to put the header file in this header file.
The second type: Using Swift in OC
Steps:
Basically the same as above, only need to create a new Swift class can be, there will be a bridge file, but the purpose of this bridging file is mainly to let Swift with OC class, not let OC with the Swift class.
The use of the Swift class by the OC class really works in the following points:
First:
Locate the project file->targets->build settings->packaging->defines Module->yes or search directly inside Build Settings defines Module
Second:
Locate the project file->targets->build settings->packaging->product Module Name, remember this field or search for Product directly in Build Settings Module Name
Third:
Add this paragraph in the PCH file, do not know the PCH dot here the function and configuration of the PCH file
#import "The field-swift.h you have just remembered"
OK, so you can invoke the Swift class in the OC environment.
Swift and OC Mixed