Keep your iPhone and iPad safe
It's a good thing that you now know how to get rid of buggy apps and viruses from your iPhone and iPad. But, with only a modest amount of effort, you can prevent a problem in the first place. Doing these two things will go a long way to keeping your iPhone or iPad virus-free.
1. Never jailbreak your iPhone or iPad, meaning bypass its security features, to download unauthorized apps
2. Keep your iPhone and iPad up-to-date: Settings >> General >> Software update