Yes, swimming is better than the gym because, in swimming, your full body is doing the workout. It helps you to build muscles and improve immobility. While in the gym, just lifting weight will make your muscles strong only.