If you hurt your shoulder swimming, you may make it worse at the gym.
I had shoulder overuse injury as well, and it impacted my swimming. Physical therapist had me switch to resistance bands like
these for shoulder-specific strengthening (rotator cuff work). Super easy to use at home.
Also, if you'd like to continue swimming, just switch to lower stress stroke such as taught in Total Immersion (YouTube it).