It looks like you're new here. If you want to get involved, click one of these buttons!
need some more info, how long had you been swimming when it happened, did you notice it to start with then got worse, was it in a pool or open water etc
I used to get cramp when swimming when finishing a length and trying to push off for another, found I was to near the wall for pushing off
I used to swim competitively until I was about 21 and then stopped. Never really had problems with cramp. I came back to swimming a few years later and now every time I do a hard swimming session I manage to get cramp in at least one of my calves. I put it down to reduced flexibility in my legs (ankles / lower leg) meaning that when I point my toes in the kick, it does something to the calf muscle. Also, I'm guilty of not relaxing the legs enough - trying to force the kick too much. Oh and pushing off the wall too hard doesn't help either. Of course, I could be completely wrong, but they are my theories - for what they're worth!
Improve your flexibility would be my advice.