The latest iPhones have been water resistant, but if you drop them in the water while charging or connected to some other accessory, you may still have a problem because the Lightning connector itself can get wet and cause a short circuit.
Apple seems to have looked for ways to prevent this, as detailed in a series of patent applications published today. A couple of applications, discovered for the first time by Patently Apple, handle this in a simple way: they propose changing the shape of the Apple Lightning connector (or some other cable) into a wedge, which would pass through a protective door and seal the entrance when inserted. It seems relatively simple, apart from all the "insert a new connector".
The other application is much more involved: it proposes allowing the phone or some other device to form a vacuum seal when the cable is connected. There would literally be a generator and pistons inside the device to be able to do this. Apple also proposes using the generator as a way to create vibrations in the device, which is a nice touch.
The images in the patent application suggest that Apple is thinking of this mainly as a way to allow the accessories to be waterproof, so instead of the generator being inside an iPhone, the generator should go into an accessory that needs waterproofing additional, allowing you to go underwater while connected to the phone. The application also describes a pop-up interface on the phone, which a user would need to control to activate and break the vacuum seal.
While additional waterproofing is usually an advantage, do not assume that any of these concepts will arrive in real products. Apple originally filed these patents in September 2016, when it added water resistance to the iPhone, without any clue of these characteristics. That does not mean that Apple will never make these changes, but the company has a large number of patents that it never looks for as commercial products. Still, it's an idea of what the company is thinking. Now we just have to hope that you are not planning to introduce another new connection standard.