"Locking" an iPhone usually refers to pressing the top button to turn off the screen. However, iOS 8 includes security features to require a passcode or a registered fingerprint to turn on the screen and use the iPhone. If the Passcode setting is enabled, the top button then locks your iPhone to secure it. Go to the "Passcode" section of the Settings app to edit the method by which you secure your phone and to choose what you can still access while it's locked.
Click "Passcode" in your Settings app. It's marked with a padlock icon. If your phone is equipped to scan fingerprints, the setting is "Touch ID and Passcode" next to a fingerprint icon.
Choose "Turn Passcode On" in the Passcode settings options to require a four-digit numeric code to unlock your phone.
Enter a four-digit code. Enter it a second time to confirm.
Disable Siri in the Passcode settings for extra security. Use the toggle switch labeled "Siri" in the "Allow Access When Locked" section of the Passcode settings.
When this setting is enabled, which is the default, anyone can view notes and call history, make calls, post to Facebook and even send and read email while the screen is locked. The safest thing to do is to disable Siri on the lock screen.
For even tighter security, turn off the toggle switch next to "Simple Passcode" in the Passcode settings. This feature requires a longer password using not just numbers, but also letters and symbols.
IOS 8 disables the iPhone if you enter the wrong passcode six consecutive times, but it lets you try again after one minute. If you cannot remember your passcode, you have to erase and restore your iPhone using iTunes on your computer.
Activate the toggle switch next to "Erase Data" in the Passcode settings to set your iPhone to erase itself after 10 failed attempts at the passcode.