While swimming engages all the muscles in your body, there are multiple ways to engage different muscles separately.
Want to target your quadriceps, hamstrings, and the rest of your leg muscles? Get a kick board, and get a few laps in kicking with your legs. Additionally, you can always use fins and get your lower body working harder.
If you'd like to focus more on your upper body muscles, paddles and pull buoy can come in handy. Swimming with them will let your lower body rest, while your back, shoulder, core, and arm muscles are putting in some work.
Lastly, you can always add more resistance with a parachute, drag socks or shorts, and other resistance equipment that will make your muscle work a little bit harder. All of those little exercise tips can build muscle better than a couple of sets of pull-ups.