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

Port FlickrKit to OS X #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

randomsequence
Copy link

Initial port to the Mac. Note the tests don't work (though they don't seem to work on iOS either).

Ref #2

Ref devedup/FlickrKit#/2
@devedup
Copy link
Owner

devedup commented Nov 19, 2013

Cool, I like this. Thanks.

I've never done a Mac port before. Is it really necessary to have the if/else for the whole methods when at times the only difference is one class: i.e. NSImage or UIImage.

Wouldn't it be more succinct to instead create a typedef: e.g.

#if TARGET_OS_IPHONE
typedef UIImage DUImage;
#elif TARGET_OS_MAC
typedef NSImage DUImage
#endif

This way you wouldn't have so much duplicated code, and it would be slightly easier to read and maintain.

@randomsequence
Copy link
Author

Yes, I've used that approach too. Personally I find the system types easier to scan. The methods on each aren't identical (or even close), so you'll still be using pre-processor conditions wherever you try to do anything with them.

I actually went back after this and added a new method to upload an image directly from a file (randomsequence/FlickrKit@015c705). Perhaps the best approach is to make that the default implementation and create OS specific categories for each platform's image type.

@raxcat raxcat mentioned this pull request Oct 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants