Skip to content
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

Open
x3ro opened this issue Apr 29, 2014 · 7 comments
Open

What about OS X compatibility for this library? #21

x3ro opened this issue Apr 29, 2014 · 7 comments

Comments

@x3ro
Copy link

x3ro commented Apr 29, 2014

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? 😄

@ggdiez
Copy link
Member

ggdiez commented Apr 30, 2014

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.

  • "setShouldExecuteAsBackgroundTaskWithExpirationHandler" specifies that the operation should continue execution after the app has entered the background, and the expiration handler for that background task.

@x3ro
Copy link
Author

x3ro commented Apr 30, 2014

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.

@DeepDiver1975
Copy link
Member

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.

@ggdiez @x3ro Does that make sense?

@ggdiez
Copy link
Member

ggdiez commented Apr 30, 2014

Of course @DeepDiver1975 makes sense.

@dfjdejulio
Copy link

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

@dfjdejulio
Copy link

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.

@dfjdejulio
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants