Subtle distinction, I'd say it depends more on context. The two sentences are basically interchangeable, unless you want to say (for example) "I like to swim once a week" or "I like to swim when I have the energy", in which case "I like swimming" would be wrong.