Years ago I dropped my pager into the toilet! Luckily post flush but still.
I pulled it out and rinsed it off. I opened it up and rinsed the internals with fresh water and shook it dry. I placed all the parts on a cookie sheet and put them in a 150 degree oven for an hour.
I reassembled it and it came to life right away. But it took a few hours till it would receive pages, my hunch is that residual moisture detuned the radio. Used it for a number of years after that.
By and large electronics are totally immune to water. I have washed populated circuit boards in the dishwasher before. The big concern is allowing the water to cause corrosion if it is moist too long. The drying needs to be done FAST.
Ideally it would help if you had the tools to pop the phone open, an iPhone is easy to open but you need a P1 Pentalobe screwdriver and a suction cup screen tool. To dump out the water and maybe give it a quick alcohol wash would really help. The rice trick is commonly stated but it likely isn't any better then a warm oven or a place with airflow. Putting the device in a ZipLock bag with Silica Gel desiccant might work well.
Unfortunately I fear that just waiting for the phone to dry without opening it will not end up well. It could take days before it truly dries out
The phone has a sticker inside of it that changes color if it is exposed to water, so don't try to tell Apple "It just quit" lol
I had a friend that was canoeing years ago and they capsized the boat. He had two Nikon N90 SLR bodies go into the lake. He called the tech and the advice was to open the cameras up and douse them with distilled water. Then place each body into a ZipLock bag FULL of more distilled water (lack of air minimizes corrosion), and get them to the repair shop ASAP. Both cameras were fully functional after repair.