This is a Good setup if you have Privacy Concern. when you leave your ios device unattendad so that they will not be able to read some part of your i/messages.
Be sure to put a Passcode on your Phone so that it will not easily be opened by others.
How to SetUp.
Go to Setting > Notification and browse to Messages as shown on the screenshot.
Toggle On/Off the Show Preview.
Tips: if you're like me who wants a preview of the message (like im driving) turn it on. so that you can easily know the reply's without unlocking the Phone.
Toggle Show Preview Off when your phone is unattended. like leaving the phone charging or when your asleep.
Hope this Helps. FOLLOW ME and ill upload some tips and tricks for your Apple devices.