The right way to extend or customize cocoapods

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

I know that the source can be edited directly, but this does not seem to be the right solution.

+4
source share
1 answer

As far as I know, CocoaPods are not intended to make any changes to the framework and the contribution to the framework. This is a good way to copy something into your project.

You can extend classes using categories to add new methods and related links to add new variables. This will not affect the modularity of the module / frame, and you will not lose your changes.

You can also use composition or inheritance. It’s good practice to use composition rather than inheritance.

If you want to contribute to a third-party library, perhaps you should get the repository of this third-party library separately, make changes, and then make a transfer request. Or you can use git submodules to add a third-party library and bind it to your own separate git repository, for example in GitHub.

+4
source

Source: https://habr.com/ru/post/1495878/


All Articles