Giter VIP home page Giter VIP logo

Comments (12)

rs avatar rs commented on May 22, 2024

This is to allow compilation with old SDK (<4.0). This is certainly no longer needed but it doesn't hurt I guess.

from sdwebimage.

jfradj avatar jfradj commented on May 22, 2024

This is to allow compilation with old SDK (<4.0). ==> that's exactly what the #if does ;-) Maybe I've not be very explicit. I talked about the if ([device respondsToSelector ..., not the #if. I think it's useless to have the both checks.

This is certainly no longer needed but it doesn't hurt I guess. ==> I guess too. I was reading your class to help me writing my own cache with GCD and Blocks and because I do not like useless code I took 1 min to report it to you ^^

Cheers,

from sdwebimage.

rs avatar rs commented on May 22, 2024

The runtime condition is for when compile for 4.0+ and run it on 3.x

from sdwebimage.

jfradj avatar jfradj commented on May 22, 2024

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_4_0 ==> compile time check, the code will not be executed on device running on 3.x, and can be compiled for those devices => everything is OK.

On device running on 4.0+, the key UIApplicationDidEnterBackgroundNotification will be defined and the notification handler will be called only if the device support multitasking => so the runtime check is useless

PS: excusez moi d'insister c'est juste pour clarifier mes propos et surtout être sûr que je ne me plante pas... On peut continuer cette conversation par mail ([email protected]) si vous voulez ;-)

from sdwebimage.

rs avatar rs commented on May 22, 2024

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_4_0 ==> compile time check, the code will not be executed on device running on 3.x […]

I think you may be wrong here: if the code is compiled with 4.0+ SDK, it can still be executed on devices running 3.0 depending on deployment version setting. On those devices, the UIDevice's isMultitaskingSupported selector won't be defined and calling it without runtime check will lead to a crash.

from sdwebimage.

jfradj avatar jfradj commented on May 22, 2024

Maybe I'm wrong... I wanted to make some tests to confirm that, but the code in the #if is never executed...
I'm probably too tired. I'll give it a try another day and keep you posted ^^

from sdwebimage.

rs avatar rs commented on May 22, 2024

Ok, I'm interested by the result of your test. In the meantime, I keep the code that way. Thanks.

from sdwebimage.

jfradj avatar jfradj commented on May 22, 2024

Ok.
In the meantime check out this great blog post => http://mattgemmell.com/2011/12/05/latest-version/
Ok ok, it's a big dilema with apps like yours but you could drive huge amounts of users to update their phone and help all developers to not gone crazy with that kinds of segmentation issues.
;-)

from sdwebimage.

rs avatar rs commented on May 22, 2024

I saw this blog post. I don't totaly agree with it but this is subjective feeling. Anyways, I think it's not the role of a low level library to decide which version of iOS your app will support. Its role is to make sure it will do all the extra-work to ensure it will complet its task in all circonstances. It's why I don't rush on ARC, blocks and GCD for this project as ROI isn't evident.

from sdwebimage.

jfradj avatar jfradj commented on May 22, 2024

That's a good point.
I'm agree with you for ARC, but not so much for GCD and blocks because there were introduced with iOS 4.0 and I don't know the exact percentage of users on iOS 3.x but it is really really low, and for me the ROI is evident ;-)

Bye

from sdwebimage.

rs avatar rs commented on May 22, 2024

You mean in term of performance or ease of use? Because in term of perf, I'm not convinced it would change anything actually. If you implement GCD, I would be interested by a comparative bench to see if my feelings were right :)

from sdwebimage.

jfradj avatar jfradj commented on May 22, 2024

I mean in ease of use, but a bench could be cool ;-)

I'll finish my library, test it a lot and then push it on github.
Could you make the bench? I didn't have to do it before the next few weeks...

from sdwebimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.