VERIFY: Is iPhone warning real or a virus?

Viruses from hackers that appear as warnings on iPhones are becoming more and more common, so how do you know when a notification is real or not.