URLSession and the missing policy

Hi !

Usually you want to make your app behave better under poor network conditions but you also want it to fetch the latest data when available.  In terms of caching policy it would mean : “loadFromWebElseUseCache”

Unfortunately it does not exists.  What’s available is :

Some of them aren’t even implemented !  I solved the problem by using two different URLSession :

Hope you like it !

Cheers,

MAB

Good vibrations

Hi !  I was recently asked to make the iPhone vibrate while using the app (not by notification).  It’s been a while since I had to do it and back then it was in Obj-C. Here’s how to achieve it in Swift:

Cheers,

MAB