Swimming, as any other physical activity, burns calories. Depending on your total calorie intake vs. calorie expenditure, you might lose weight.
If you want a metabolic shift (less fat, more muscles, same weight), weightlifting is the better alternative.
Of course, your diet counts when...