-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What about OS X compatibility for this library? #21
Comments
Hi x3ro, The library is make only for iOS. But If you have interest you can do a fork and improve this with OS X support.
|
Sure it'd be a possibility to fork, but maybe it'd be an option to incorporate OS X support into the library, since I believe that there aren't many things in which both libraries would differ. AFNetworking seems to do the same thing, if I'm not mistaken. |
I cannot judge over the differences between iOS and OS X APIs and how big the effort is to provide a library which is compatible to run on both platforms - but generally speaking: a fork is the very last solution we should aim for. @x3ro feel free to work on OS X compatibility and submit pull requests to this repo - we will happily review the changes and then we can judge if if it makes sense to walk this path. |
Of course @DeepDiver1975 makes sense. |
FYI, one can get most of the unit tests working under OS X pretty quickly. One "trick" was to wrap the "background task with exception handler" stuff with the same #if statement that AFNetworking uses. Beyond that, it was mostly dealing with modernizing for ARC (which I'm not sure I did cleanly, so I'm going to take another stab at it before sharing what I've done). I'm hoping to build a new desktop sync client on top of this afterwards, to have one that behaves more like a standard OS X application. (I can't get the distributed one to pay attention to custom CAs in my keychain and stuff like that.) |
I just took a stab at a pull request for this, but I'm fairly new to working with git, so I'm not sure I did it correctly. Please let me know if I need to do something different. |
Details: I based this work off of "devel" instead of "master", and as a result there was less to do than my prior attempt. I didn't really have to do much besides change an import from "UIKit" to "Foundation" (since none of the code actually depended on anything from UIKit anyway), and wrapping the call to the AFNetworking method that only exists on iOS in exactly the same dependency that determines whether AFNetworking will build that method. After that, I got the same results from unit testing on OS X that I got from unit testing on iOS. |
Is there something I missed already in existence or is there already someone using this from OS X instead of iOS?
The only thing currently keeping it from compiling with a 10.9 target is the use of
setShouldExecuteAsBackgroundTaskWithExpirationHandler
. If I'm understanding it correctly, this handler is only used to cancel an operation when the iOS app runs out of background time? Or is this used differently in places I've not yet found? 😄The text was updated successfully, but these errors were encountered: