Interestingly enough, the latest iOS has a do not disturbed function that disables text, email and phone when the system detects that you are in a car in motion. It is a default setting that you have to manually change if you want to turn it off.
Apple is ahead of the curve anticipating regulations banning the use of phones, e-mail and text while driving. All they have to do is a slight alteration to the code to keep you from disabling it.
When I first updated my iOS I wondered why I wasn’t getting I coming calls on my hands-free phone system in the car when I was driving and they were all being sent to voice mail.