Checking Twitter
the other day I stumble this tweets from Sash Zats addressing some heuristics for enabling/disabling intensive animations in iOS
apps:
[1/4] When performing intensive animations or other auxiliary work consider creating a helper checking following (in no particular order):
— Sash Zats (@zats) September 19, 2017
[2/4]
— Sash Zats (@zats) September 19, 2017
• NSProcessInfo thermalState - is device already working hard
• NSProcessInfo isLowPowerModeEnabled - is user trying to safe battery
[3/4]
— Sash Zats (@zats) September 19, 2017
• UIAccessibilityIsReduceMotionEnabled - is user sensitive to motion
[4/4]
— Sash Zats (@zats) September 19, 2017
• UIDevice batteryState & batteryLevel - to know when device is not charging and low on battery
Any other heuristics that I'm missing?
That definitely resonated in me and made me realised with horror that I have never «bothered» to even consider any of this things before performing intensive blocks of animation.
Below on the thread Marin Todorov provided a link to this checks added to RxAnimated
(Here’s the link to the specific line of code: shouldDisableAnimationsViaDefaultHeuristics).
From now on this is something that I’ll definitely be doing on my apps and would probably keep updating it as more I find more heuristics to be applied to this check. Edit: There isn’t much to this blog post other than drawing attention to the heuristics and hopefully raising awareness so more developers start to use them.