-
Swift
Use thepod
imported third-class library to use it easily.
InSwift5.0
here, you can directly use thepod
imported third-party library without using the bridge file.import
You can use the third-party library directly by directly using the third library class name.
However, such a processing method requires animport
operation that needs to be performed in every place where the third party is needed , which is too troublesome. -
Use bridge files to achieve the same effect as
Objective-C
internalpch
files
1. Create a file, select Create Header File
, and name the file for distinction xxx-Bridging-Header
.
2. Modify the configuration and open it Build Setting
.
2.1. Search Objective-C Briding Header
, and then perform similar operations as shown in Figure
2.2. Search User Header Search Path
, and then perform operations as shown in Figure
2.3. Import third-party libraries xxx-Bridging-Heade.h
, as shown
in the figure. After performing the above operations, do not perform import
operations where third parties are needed . The effect is as follows:
Note: When pod
importing a third party, you also need to pay attention to some operations, Profile
add use_frameworks!
this line of code to the file.