Apple's patent application for self-healing elastomer could lead to waterproof iPhones
As an example, consider an earphone jack covered by an elastomer seal. When a plug is pushed into the jack, the seal would open up to allow the plug to be inserted into the port. Once the plug is removed, the rubber reverts back to its original shape and protects the port by covering it. The rubber covering can be made to protect against water, dust, debris and gas.
The patent is called "Electronic device with hidden connector." Apple does own a patent for a waterproof logicboard which has been employed in the Apple iPhone 6s and Apple iPhone 6s Plus. This could explain why the two phones stand up well to water, even though they are not considered water resistant.
source: USPTO via AppleInsider