The configuration of the podSpec file is roughly as follows

S.framework = "UIKit" s.dependency 'Alamofire', '~> 4.7' s.dependency 'MBProgressHUD', '~> 1.2.0'Copy the code

Error while using private library

[!]  The following Swift pods cannot yet be integrated as static libraries: The Swift pod `xxxx` depends upon `MBProgressHUD`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers! ` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.Copy the code

There are three solutions

1) You can add it to the top of your Podfile

use_frameworks! Target 'XXXXXX' do pod 'MBProgressHUD', '~> 1.2.0' endCopy the code

The principle is to compile the library inside the POD into frameworks

2) You can also add it to the top of your Podfile

use_modular_headers! Target 'XXXXXX' do pod 'MBProgressHUD', '~> 1.2.0' endCopy the code

The principle is to compile the pod libraries into Modular modules, which can be imported directly into Swift, without needing to be bridged through the bridge-header

3. Because use_modular_headers! To compile all pod libraries as Modular, or just one library, the Podfile looks like this:

Target 'XXXXXX' do pod 'MBProgressHUD', '~> 1.2.0', : Modular_headers => true endCopy the code