Install RestKit without AFNetworking - ios

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.

Related

Adding RestKit framework into Cathrag

why the RestKit framework is not adding in the cathrage for IOS, I have followed the exact instructions from https://github.com/watson-developer-cloud/swift-sdk/ repo but not able to solve it. Kindly help me.
Unfortunately, our documentation is a little out-of-date. Since v0.19.0 we have removed the RestKit framework. No need to build it or include it in your app.

Would adding Parse to an IOS Framework cause issues?

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.

How to use AFNetworking 2.0+ with old AFNetworking?

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).

iOS Facebook SDK: show progress of received data with FBURLConnection

I'm using the Facebook-SDK to make some FQL queries. Now I want to know how much of the requested data has already been transferred to the app to visualize the loading process in a progressbar.
So I used this https://github.com/nyankichi820/FBRequestConnection-FBRequestConnection_progress plugin which extends the FBURLConnection class to provide the progress of a data transfer.
The problem is, that I included the Facebook-SDK as an XCode framework into the project and the header file FBURLConnection.h which is necessary for the plugin is not published in the framework and cannot be found.
So how can I include the header file FBURLConnection.h into the frameworks visible headers so that I can access it? I dont't want to include all the FB-SDK files, I wanted to do this by relying on the XCode framework structure. Thanks in advance.
You should probably include the source of the framework yourself manually or much more simply using cocoapods.
Here is the github link to the SDK source: https://github.com/facebook/facebook-ios-sdk
The official cocoapod is named "Facebook-iOS-SDK", if you decide to go that route. I recommend doing this as it is much simpler to install the SDK and update it later on. Cocoapods are very nice for external components in general and will almost certainly save you time and frustration in the long run.

Using two versions of a Cocoapod dependency

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 =)

Resources