pmusolino / PMAlertController

PMAlertController is a great and customizable alert that can substitute UIAlertController
MIT License
2.53k stars 186 forks source link

use use_modular_headers! #68

Closed mario-huang closed 6 years ago

mario-huang commented 6 years ago

For some reason, I am not using use_frameworks!, but use_modular_headers! instead. Then it comes with error:

Unable to run command 'StripNIB PMAlertController.nib' - this target might include its own product.
Unable to run command 'StripNIB PMAlertController~iphone.nib' - this target might include its own product.
Unable to run command 'StripNIB PMAlertController~ipad.nib' - this target might include its own product.
pmusolino commented 6 years ago

Can you try using pod 'PMAlertController', :modular_headers => false,?

mario-huang commented 6 years ago

Yes, I tried, but it didn't work.

VincentSit commented 6 years ago

Static libraries are completely different from dynamic frameworks, it is not a container or bundle.

A static library is a single file that contains classes, code and variables that were linked together by the library creator. It does not "contain" other files, it is essentially a database of compiled code.

Based on the above explanation, you can not use PMAlertController as a static library since you can not package xib file into static library.

use_modular_headers! is needed only if your Swift pod depends on an Objective-C pod. Detailed here. It doesn't make sense to use it here.

CocoaPods currently does not support mixing static libraries and dynamic frameworks in a project, and from their Issue, there is little likelihood of future support.

So I suggest you keep other pods as static libraries and package PMAlertController into a dynamic framework separately, used as an embedded framework. To do this, Carthage can help you.

pmusolino commented 6 years ago

Thanks @VincentSit for clarifying this aspect.