Skip to content

Instantly share code, notes, and snippets.

@ericjkunz
Created September 22, 2017 14:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericjkunz/5e4b90a7409ad7da4ff55845476445bb to your computer and use it in GitHub Desktop.
Save ericjkunz/5e4b90a7409ad7da4ff55845476445bb to your computer and use it in GitHub Desktop.
func shouldPerformIntensiveUnecessaryAnimation() -> Bool {
return ProcessInfo.processInfo.thermalState != ProcessInfo.ThermalState.critical ||
!ProcessInfo.processInfo.isLowPowerModeEnabled ||
!UIAccessibilityIsReduceMotionEnabled() ||
!(UIDevice.current.batteryLevel < 10 && UIDevice.current.batteryState == .unplugged)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment