Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include ".framework" file to cocoapods

I'm trying to add "Custom.framework" to my pod (cocoapods). And I'm a bit stuck with pod spec setup. I've done following:


s.resources = ['Resources/Custom.framework']
s.preserve_paths = "Resources/Custom.framework"
s.frameworks  = "UIKit", "Custom"

But in project where I'm using this pod, I'm getting error

<Custom/Custom.h> not found

or something similar.

I'm stuck already for a few hours and I can't find answer to my question in google.

BR, Pavlo.

like image 855
Tunyk Pavel Avatar asked Nov 15 '14 20:11

Tunyk Pavel


People also ask

How do I add dependencies to CocoaPods?

After you have initially installed CocoaPods into your project, you can add new dependencies (or remove unused ones) by editing the Podfile. Then simply run pod install again.

Can you use SPM and CocoaPods?

There are two ways to get started to set up your library's folder structure: You can either set up a project with CocoaPods and then adjust it in order to work with SPM, or you can do it the other way around and start with the Swift Package Manager. file.

Does CocoaPods support XCFramework?

Cocoapods too supports the distribution and consumption of XCFramework.


1 Answers

What you want is the vendored_frameworks attribute. In your case it looks like you'd want to use it like this:

s.vendored_frameworks = 'Resources/Custom.framework'

This automatically deals with preserving the path and linking the framework itself so you don't need either of those attributes for your custom framework.

like image 82
Keith Smiley Avatar answered Oct 05 '22 16:10

Keith Smiley