Apple introduced a new kind of alarm in iOS 10 called Bedtime. This alarm helps you get a fixed amount of sleep everyday. If your daily sleep requirement is 8 hours, you can tell the Clock app what time it is you need to get up and it will tell you when to go to bed to get enough sleep, and wake up on time. It’s great but if you manage to get to bed on time and forget to turn on Do Not Disturb, your sleep isn’t going to be uninterrupted. Apple seems to have caught on which is why you can automatically enable do not disturb for Bedtime on iOS 12.
In order to enable do not disturb for Bedtime, you need to first turn on the Bedtime alarm. This is a new feature in iOS 12 which is currently in beta. The stable version will be released in September/October 2018. If you want to try it out now, you can join the Apple Public Beta program.
Open the Clock app and go to the Bedtime tab. Turn Bedtime on, and configure it however you want. Once you’re done, tap the Options button at the top left. On the Bedtime Options screen, you will see a ‘Do not disturb during Bedtime’ switch. Turn it on, and when it’s bedtime, iOS will automatically turn Do Not Disturb on.
Once the option is enabled, your screen will no longer wake up when you get a new notification. The usual rules will apply; no phone calls and no messages will come through although if you get repeated calls from a contact, the notification will come through.
If your phone is unlocked, and in your hand i.e., you’re not really sleeping when you should be, you will get notifications. Do not disturb works when your phone is locked so if you’re going through it during your Bedtime, you will get new alerts.
On iOS 11, you can sort of still get this feature. The thing about Do Not Disturb is that you can schedule it so all you have to do is schedule it to start the same time as your Bedtime, and end it when you wake up. The downside of using this workaround is that when/if you change the Bedtime alarm, you will have to remember to change the Do Not Disturb schedule. Also, if you use Do Not Disturb for some other part of the day e.g., the first half of the workday, you will have to choose between the two.