How to prevent random shutdowns on your iPhone or iPad