Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Right way to extend or customize cocoapods

What is the correct way to extend or customize a Framework(pod) when using cocoapods to manage it in the project.

I know the source can be edited directly but it doesn't seem to be the right solution.

like image 929
carbonr Avatar asked Aug 08 '13 05:08

carbonr


1 Answers

As far as I know, CocoaPods are not intended to make any changes to frameworks and contribution to frameworks. They are a good way to copy something to your project only.

You can extend classes using categories for adding new methods and associated references for adding new variables. This will not affect the modularity of a pod/framework and you will not loose your changes.

You can also use composition or inheritance. It is a good practice to use composition rather than inheritance.

If you want to make a contribution to a third party library, probably, you should get a repository of that third party library separately, make changes and then make a pull request. Or you can use git submodules to add a third party library and bind it to it's own separate git repository, for instance in GitHub.

like image 172
Denis Kutlubaev Avatar answered Oct 22 '22 14:10

Denis Kutlubaev