Anas bin Malik narrated that Allah's Messenger said:
"Allah is more pleased with the repentance of His slave than anyone of you is pleased with finding his camel which he had lost in a desert."
[Sahih Al-Bukhari, Vol.8, Hadeeth No.6309]
As human beings, we are weak by nature. This is very much so because of the element of 'desire' that we have in us. And so, we sometimes follow these desires blindly and wrongly to our own destruction. We disobey Allah and break His rules in the process and transgress the divine limits set for us. And we become sinners.
But Allah is Most Forgiving and Most Merciful. He is always willing to forgive us no matter the number of times we have committed sins. His doors of forgiveness are widely open. And Allah is happier than any man cited in the above Hadeeth when His slave (man or woman) repents. But we must be SINCERE in our repentance. And "...indeed Allah loves those who repent and loves who purify themselves." Qur'an 2:222
Smoking whilst fasting will break the fast & result in Qadha & Kaffarah for one who generally smokes.
Also Swimming whilst fasting will not break your fast so long as water is not swallowed nor taken up nose.