Search code examples
iosobjective-ccocoapodsreachability

How to resolve different CocoaPods using different implementations of Reachability?


Our app has been happily using tonymillion's Reachability CocoaPod for months. Now we're trying to incorporate the MendeleyKit CocoaPod, but it includes the source for Apple's Reachability class, and the compiler doesn't like this because it's trying to link our code against the Reachability class that MendeleyKit includes.

Is there a way we can fix this collision in our own project? Or do I have to convince the Mendeley devs to add tonymillion's pod as a dependency? Or do I need to convince tonymillion to add a prefix to his class?


Solution

  • Yes to all of those.

    • You could skip the Pod implementation of Reachability, and make the prefix changes yourself.
    • You could ask the other Pod to use tonymillion, but likely would take longer. And they have no benefit to do so. (Although you could submit a pull request and do the work for them, might have a better chance)
    • You could ask tonymillion to prefix his class too, but like before, no benefit for them to do so. (Pull requests never hurt anyone)

    It will all boil down to what you have time for. Doing it yourself is likely quickest. You could also fork Reachability, prefix it yourself, then use your own source to supply the pod. So I think you have plenty of options to resolve the issue. Just how much time do you want to spend on it.