Good idea. Save lives.
Soon, iPhones will block texts while drive.
Whenever the phone is connected to a car using either Bluetooth or a cable, or if the car is moving, the phone will withhold any notifications for things like text messages or news updates.
If someone does text you while you're driving, the phone can respond with an automatic message telling them you're driving and can't respond just now.