Can iPhones be infected with Trojans?

So my Wi-Fi network at home got hacked with a "stealth Trojan". I use a MacBook, iPhone, and iPad on the Wi-Fi and I turned off my MacBook and iPad just in case. I'm using my phone to ask this. I'm just wondering, can an iPhone/iPad be hacked with a Trojan? And what about a MacBook?

A trojan is a gathering name for malicious code that gets complete access over your device and opens a backdoor that allows a user to control your device.

Good news is that unless your iPhone is jailbroken your safe.
There are very few people (if any) that actually have an exploit that allow regular iPhones to be infected by a trojan like malware.