I'm programming in Objective-C. I want to include a camera library, DLCImagePicker, in my project. There is a variable I need to change, but it is private and I have no access to it.I've thought of a few way to get around this, but am not sure on the best practice way to do it.I can just copy the code into my own class and alter the variable.I can alter it directly in the original class. However, I have included this code as a git submodule and I'm thinking that touching the source code is a bad idea in this case, and in general.Subclassing. I can't imagine how this would work, as the variable is private.I can perform some action with git that would create my own fork/branch of the project, and alter it there. I have never done this and am very primitive with git.
How do I alter an open source library for my own use?
object oriented design;libraries
You're kind of missing the point of open source, which is that in exchange for your use of software you find helpful, you're encouraged to contribute improvements back for everyone to benefit.So fork the software on github, then make the changes as you would if you owned it.  That means not just exposing a variable to make it easier to hack in external code, but employing proper encapsulation and adding whatever improved methods you need.Then submit a pull request.  Github has good tutorials on how to do this.  The author will provide suggestions for improvement, then most likely merge it in, which benefits you by not requiring you to maintain a fork and benefits him by getting useful improvements to the code.  In the unlikely event he doesn't accept the change, you have a fork available for your personal use.  Also, most open source licences encourage if not outright require publishing changes, and your github fork fulfills that requirement.