Is The iPhone Waterproof? Water Resistance Explained

Are iPhones waterproof? A few years ago companies like Apple started advertising their phones as being "water-resistant." They also started including an "IP rating" in many of their devices' specifications. But what does any of that actually mean, and most importantly, can you trust your phone in the water?