generally the more you play basketball, the better you'll be at basketball
the more you run, the better you'll be at running
the more you swim, the better you'll be at swimming
the more you pedal, the stronger/better you'll be at pedaling.
so naturally to be great at cycling, it takes lots of cycling...not substituting for other things.
the exception is that if you're feeling worn out of it mentally, need a break from year-round biking, or just feeling like the training on a bike is becoming a chore instead of something you look forward to....then yea, swimming would be a good option because its aerobic and you'll use your legs.