All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
There is no doubt that the religion urges Muslims to take care of and strengthen their bodies. A Hadeeth reads: “All things in which there is no mention of Allaah consist in frivolity and idle play except for four things: walking between two targets (i.e. archery), training horses, being playful with one’s wife, and learning to swim.” [An-Nasaa'i - Al-Munthiri said that its chain of narrators is good and Al-Albaani classified it as Saheeh (sound)]
For more benefit, please refer to Fataawa 87881 and 101619.
As regards the exercise practices of the Prophet, sallallaahu ‘alayhi wa sallam, we are not aware of any Islamic text in this regard, but some Ahaadeeth state that the Prophet, sallallaahu ‘alayhi wa sallam, exercised sometimes, but this does not mean that this was his usual practice and habit. For instance, ‘Aa’ishah narrated that she was with the Prophet while traveling. She said: “I raced with him (the Prophet, sallallaahu ‘alayhi wa sallam) and I won the race, and when I gained weight (became fleshy), I again raced with him and he won the race. The Prophet, sallallaahu ‘alayhi wa sallam, said: "This is for that win.’" [Abu Dawood - Ibn Hibbaan graded it Saheeh]
As regards the manner of swimming you mentioned, then we do not know of any text reported about this.