Apple products get hacked and get viruses just as much as everyone else, especially iOS with it's popularity, but Apple is much better at patching things and taking care of the exploit than other companies.