A new safety feature is coming to iOS 11 this fall called "Do Not Disturb While Driving," which will block unnecessary notifications to your iPhone when it's connected via Bluetooth to a vehicle. Apple said it'll also be able to use speed-detection to know if a user is in a car while it's moving.
iOS 11 introduces a new way to help drivers stay more focused on the road with Do Not Disturb while driving. iPhone can detect when you may be driving and automatically silence notifications to keep the screen dark. Users have the option of sending an auto reply to contacts listed in Favorites to let them know they are driving and cannot respond until they arrive at their destination.
When you're driving, Messages will auto-reply with a specific text message to those trying to reach you that you currently can't reply to their text. Users who are passengers will be able to tell iOS 11 and grant full notification access to their iPhone.