Apple has done a great job of making our iPhones secure. If you have data or images on your iPhone that you want no one without the code to ever be able to see, you can set your iPhone to erase all data after 10 failed passcode attempts (this will not delete data in iCloud). This is not a setting you should turn on lightly because if anyone fails to open your phone after those 10 attempts, everything on the phone disappears and you’ll have to start from scratch. However, as a security measure, it’s a great way to make sure your data is secure.
To set your iPhone to erase all data after 10 failed passcode attempts, open your Settings app. Scroll down and tap Touch ID & Passcode. Enter your passcode to continue.
Scroll to the very bottom of the page and you’ll see Erase Data. Below this it states, “Erase all data on this iPhone after 10 failed passcode attempts." Toggle on Erase Data to enable this function. It will ask you to confirm, tap Enable.