Swimming was the favorite sport of the ancient Egyptians, who made use of the River Nile to practice it. The Nile was not the only place for swimming contests. Noblemen's palaces had swimming pools in which princes learned the sport.
The calm waters of the Nile encouraged youths to hold swimming competitions in which they could show their skills. (http://www.touregypt.net/historicalessays/ancsportsk1.htm)
Royal and noble children often took swimming lessons, as mentioned in a biographical inscription of a Middle Kingdom nobleman. (http://www.bbc.co.uk/dna/h2g2/A603776)
Click here to see my other entries on the History of Swimming, including in Ancient Greece and Rome.