So I'm trying to get with the times and use some of the new features offered in AFNetworking 2.0. However, I am also using RestKit 0.20 which has AFNetworking 1.3 as a dependency? Am I allowed to incorporate AFNetworking 1.3 and 2.0 into my Xcode project or can I only pick one? Is there a CocoaPod trick for this?
https://github.com/AFNetworking/AFNetworking
https://github.com/RestKit/RestKit
CocoaPods does not (currently) do dependency resolution with multiple versions of the same library. I'm not sure about the technical difficulties surrounding this but I believe one way to think about why it would be a pain is duplicate symbol errors that we've all undoubtably seen before. Unless RestKit updates their AFNetworking integration, which would take some doing I'm sure for such a large library, you'll have to pick which one you need more.
I wanted to mention that if you're using RestKit, this framework is meant to Abstract out you Networking operations, so if you project allows for it, it would be best not to use AFNetworking directly, and let restKit do the work instead. Being that said, I would also point out that you can use the dependency used by restKit (i.e 'AFNetworking', '~> 1.3.0'), and Just Use the previous API provided by AFNetworking, in case you really need to make direct use of this library.
Hope it helps =)
Related
I know, there are so many same questions but I didn't get answer for my requirement.
First time I am creating framework. I have created test framework using Raywenderlich example. But my requirement is little bit different. I used so many different frameworks and also used SQLCipher in my project. Now, I want to convert this project into framework. I followed all the steps but the problem is occur when I am trying to build. Getting an error for SQLCypher because I didn’t add to my framework to avoid conflicts. Finally, I have added SQLCypher library to create build without error and it worked but now I am getting linker error when I am using that framework to test in testProject. I didn’t find any example with third parties. Please help me to solve this issue.
I had the same issue.
One solution is to change all method names of other frameworks or libs, but some lib is not open source.
Another solution is work for me which is to use cocoapods. But the user
who wants to use your framework will be forced using cocoapods, depending iOS 8.0 or above, depending the same version of 3rd libs. I have nothing to do with this restriction.
Seems the best way is do not depend 3rd libs in a framework.
I've got an on going project where I'm using AFNetworking for request/response layer. And I want to use RestKit's ObjectMapping functionality for my JSON responses. I tried to install RestKit via cocoapods but it's going into conflict with already installed AFNetworking pod. So I wanted to ask if there any way to install RestKit's ObjectMapping module only, and without networking layer?
You can have a look here https://github.com/RestKit/RestKit/issues/2028 where is under discussion the possibility to create a branch of RestKit without the AFNetworking dependency. In the meantime you can drop AFNetworking in your Podfile and let RestKit include it; the only downside with this approach is that you are stuck to AFNetworking 1.x.
You can add "RestKit/ObjectMapping" as a Cocoapod dependency for your project without the base networking layer.
Or else check out the work in progress for RestKit issue 2028 in https://github.com/oligriffiths/RestKit. It doesn't require AFNetworking at all, but it may need your help getting to a stable state and passing all the tests.
I want to know which is the best and most reliable method. i have looked on here for an answer but didn't come across any.
I Want to use multiple API'S in my project so please keep that in mind when answering. Any advice about the best way of doing this and most reliable method will really be appreciated. Thanks in advance!
Isit possible to download multiple SDK's into an iOS application through Xcode?
Pros of SDK:
Can be used offline
Most SDKs are small in file size
All of the functioning code is visible to you, the SDK developer can't keep many secrets
Cons of SDK:
Larger binary
More clutter in your Xcode project
Pros of API:
Smaller binary
Less 3rd party frameworks cluttering your Xcode project
Cons of API:
Can't be used offline
Tends to be a blackbox
App will need to be updated every time the API is updated
In terms of reliability, the SDK will always be functional assuming
It worked in the first place
It doesn't rely on an API in the background
You can integrate SDK using Cocoapods library.CocoaPods is a ruby gem that downloads all the third party libraries that you want for your project.
Getting a specific version of a pod is done by specifying the version number, and CocoaPods downloads that specific version for you saving you from searching through commits for it.
With CocoaPods, updating your dependancies is easily done with the pod update command.
CocoaPods also provides a central place where third party libraries can be found. This improves discoverability of open source libraries that you can use in your projects. You can use the search engine at cocoapods.org to search for pods.
If I am building a Framework that depends on Parse, would this cause issues for apps already using Parse and would like to use my framework? More specifically, if I initialize my Parse app in the framework, and then the app using this framework initializes Parse again, would they interfere?
Yes, they will and that's the reason CocoaPods exist, to ease the pain of dependency of frameworks.
Framework must not depend on another framework is the bottom line. If you do , it will leads to collisions, if the other framework also includes that framework.
I would suggest you to learn CocoaPods. The dependency problems will find the solution.
In my project I have RestKit and IDMPhotoBrowser(using Cocoapods), so there is two versions AFNetworking conflict among themselves. Do you have any idea how to use them both in same project?
There is no way to use 2 libraries with the same classes in the same project. This is what leads to duplicate symbol errors. On the topic of RestKit + AFNetworking this has been brought up a few times. There's another StackOverflow question, there's tons of issues but it sounds like they want to remove AFNetworking as a dependency entirely (from here).