It's rare, but other apes can learn to swim. So the answer to your question is almost certainly that humans have been swimming (when they need to) for as long as there have been humans.
Just a word of caution, humans' aquatic abilities are most likely a prehistoric phenomenon, so you should consider X-posting this to /r/AskAnthrpology as they are more targeted at that.