I am unsure about what may be causing this pain when you swim. Be sure you spend several minutes doing some dry-land warm up before you start your swim. In addition, start slowly once you ar in the water. Take three or five laps pretty easy before you begin to push yourself.
You may consider varying your work outs so you can give your shoulders some rest and time to heal. The rotator cuff is made up of several …4 I think, smaller muscles that can be pretty easily injured. You may want to do some simple exercises with low weights that will strengthen these muscles. You would be surprised at how a good, targeted, low weight, cable work out can help you avoid these kinds of injuries. Here is a web site with some interesting information that may be helpful.
Good luck with your work out.