A rip current is like a moving treadmill, which the swimmer can get out of quite easily by swimming at a right angle, across the current, i.e. parallel to the shore in either direction. Rip currents are usually not very wide, so getting out of one only takes a few strokes. Once out of the rip current, getting back to shore is also not difficult, since waves are breaking, and floating objects (including swimmers) will be pushed by the waves towards the shore.