Custom framework development with COCOA POD - ios

I'm creating a custom framework which uses Cocoa Pod internally. After installing POD I cannot make use of framework using agreegate target.
I added framework project with my application project just by trag and drop it inside Application project and linked it using Aggregate Target. After installing POD with custom framework, I can not make use the above mentioned way to link framework with my aggregate project.
Thanks

If you are developping a standalone librairy, something that users will have to add manually in their project, you CANNOT use cocoapod in your librairy project. No way! You'll have to provide your users with an install procedure indicating all extra step (framework install, project settings modification, pods to install) they'll have to follow to get your framework up and running.
This is why nowaday people use dependency manager like cocoapods. It makes it easier for users to install their product and install automaticly the dependencies.
If you are planning to distribute your framework thru pod, then follow the recommanded step to create your project architecture and reference in the example project (that uses pods) your dependencies.

Related

Use an iOS framework that has dependency on some pods

I have created a framework project in Xcode -that has dependency on some pods- to be able to use in different Xcode projects.
How can Xcode be informed to get that framework the dependency it needs?
You have to declare the dependencies on frameworks or on other pods in the podspec file. This file will explain to cocoapods how to correctly bind the pod in your XCode project.
You have an example at the end of the second sample in this page.

Embed a framework in a cocoapod framework project

I have an application which is using a library installing via Cocoapods.
In that library project, now I have embedded a framework and it build successfully.
Back to my application when I do pod install then build. The library pod show me error:
No such module 'embedded framework'
in the swift file which I used that framework.
I have research and try many solutions but still not work. How can I bring the embedded framework along with my library project?
Add link binaries:
Add copy files:
Still error in the main application when compile:
Go to your Xcode project General Tab. Check for Embedded Binaries.
Now, Add your missing lib. or framework here.
Check in screenshot below.
Clean and run the project.

React Native: What is the difference between using Cocoapods and manually linking modules?

I've been working with React Native for about a year, and have always linked native modules either with react-native link or by manual linking, by dragging the .xcodeproj file to the Libraries folder and then dragging the .a file to the "Link Binary With Libraries" section of Build Phases. I'd heard of Cocoapods, and my project does include a Podfile (not sure where it came from), but it wasn't until recently that someone told me I HAD to use Cocoapods in order to link native modules, by doing cd ios + pod install etc.
What I Want To Know:
What's the difference between linking native modules the way I've done it all along, and doing it via Cocoapods? What's the essence of Cocoapods and how does it fit into React Native development vs regular linking?
For manually integrated module most cases you have to link some system files if library have some dependencies but for cocoa pod all dependencies liked automatically
For manually integrated module you need to update library manually but for cocoa pod you can it by just pod install command from terminal
In which case which one is better? when your library need update frequently you should choice cocoa pod but when you want to modify a cocoa pod library you would choice it to integrated manually.

How can we share sdk/Framework which is having library, to some other project?

I want to share framework in another app. I am facing issues when I have some libraries/pods like Alamofire in my framework. what is the solution of this problem? how can i use that library in framework? Also i tried to install Alamofire pod in to the other app in which i have added framework, and tried to access in my framework class but this was not accessible. please guide me how to do it. Thank you
You can use Cocoapods to achieve that. Basically, cocoapods will create a framework for you from the source files that you define and will also install the appropriate dependencies that you define in the target project when the target project does pod install.
Apart from cocoapods, you can also use Carthage which is also a dependency management tool.
You can read more about cocoapods here and how to create a new pod here

cocoapods integration on existing workspace

I'm new to CocoaPods and was able to use it on some sample project.
Now I'm trying to integrate it into my current working project.
The project is a iOS application project which use target dependency on other some static library I've created which also uses another static library with dependency I created.
So basically it's 3 project nested in each other.
After init&install the Podfile on the main project I can't build the project
getting the error: Library not found for -IPods-MYAPPNAME.
Any ideas what should I do to integrate an existing project with many frameworks and dependencies to CocoaPods or is it a lost battle?

Resources