Water and other liquid damage to iPhone or iPod isn't covered by warranty - http://support.apple.com/HT204104 - "iPhone and most iPod devices are equipped with Liquid Contact Indicators (LCIs) that you can see from the outside."
If you see a liquid-detection alert on your iPhone, click here --> https://support.apple.com/HT210424
Read 'About splash, water, and dust resistance of iPhone 7 and later '. Click here --> https://support.apple.com/HT207043
For the 'iPhone Service Answer Center' click here --> https://support.apple.com/iPhone/repair/service
For instructions on how to 'Get your iPhone, iPad, or iPod touch ready for service' click here --> https://support.apple.com/HT201557
- "To protect your information and save time, follow these steps before you get service for your device."