If you have a virus on your iPhone or iPad, there's a very good chance your phone was infected with an app that you didn't find in the App Store. However it got there, though, you need to get rid of it.
1. Restart your iPhone or iPad: Hold down the power button until you see Slide to Power Off >> touch and slide until it turns off. To turn it back on, hold down the power button for a few seconds until you see an Apple logo.
2. Clear your history: Settings >> Safari >> Clear History and Website Data >> tap Clear.
3. Restore your iPhone or iPad to a recent backup. Make sure your device is set to automatically backup. If it is, you can restore it to an earlier backup, when you weren't having problems. To turn on Backup: Settings >> iCloud >> turn on Backup.
4. Visit an Apple Store to see if they can help remove the virus.
5. Proceed with extreme caution. If all else fails, you can wipe everything off your iPhone or iPad and start over. That means you erase everything from your smartphone or tablet, and start from scratch. To do that: Settings >> General >> Reset >> Erase All Content and Settings.