简体   繁体   中英

Feasibility of using Good Dynamics instead of AFNetworking in RestKit

I realize this question is somewhat general; however, I'm trying to ascertain the complexity of using Good Dynamics' iOS SDK for RestKit's network operations instead of AFNetworking. I'm basically looking into the possibility of decoupling AFNetworking from RestKit and using GD instead. We're working on integrating RestKit into an existing project that uses GD for network operations, so that's where the interest comes from.

From examining RestKit, it looks like the hooks into AFNetworking happen in two or three RK classes. I've used RestKit on a few projects, but haven't really examined it on the networking level too closely (and to be honest, that aspect is a little above my current skill level), so I was hoping to hear from folks that were familiar with any combination of AFNetworking, Good Dynamics, and RestKit 0.2x, so as to help me ascertain its feasibility. Thanks!

It's feasible. Your best approach is probably to find all of the subclasses of AFNetworking classes in RestKit and create your own versions of those AFNetworking classes such that they provide the same interface and features but backed by GD.

If you want to you could use swizzling to make the substitution. It may be less effort but it would be more fragile if you did choose to continue updating versions.

Obviously when RestKit moves to AFN 2 you'll have to stop updating or redo your changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM