Your teacher is correct: aerobic conditioning is specific and practice running will make you a better runner, but won't necessarily do much for your swimming. For one thing, running doesn't help you adapt more efficiently to the movements required by swimming. Furthermore, cardiovascular fitness is specific at the cellular level; it's not a systemic thing per conventional wisdom.
Body By Science (p. 40) reports on one salient study:
An elegant study was performed in 1976 in which the experimenters
recruited thirteen subjects and trained them on a stationary bike.
However, they had them train only one leg; the other leg wasn't
trained at all. The trained leg employed a sprint and/or an endurance
(steady-state) protocol. The subjects performed four or five such
workouts per week for four weeks. After the study, when the
researchers tested the subjects' VO2 max by having them exercise with
the trained limb, they noted an increase in VO2 max of 23 percent.
This low-intensity, steady-state exercise was supposed to produce a
central cardiovascular adaptation, but when the experimenters tested
the subjects' untrained legs, they discovered that the untrained limbs
showed no improvement in VO2 max at all.
(Study: B. Saltin, et al., "The Nature of the Training Response: Peripheral and Central Adaptations of One-Legged Exercise," Acta Physiologica Scandinavica 96, no. 3 (March 1976): 289-305.)
This also speaks to the fact that if you choose running as your
exercise, any improvement in your VO2 max will be restricted to your
legs for the activity of running. It's not having a central
adaptation, as the muscles in your trunk and arms will be largely
unaffected, and the effect will not be transferable to any other
exercise modality.
My advice to you: if you want to build endurance swimming, then swim more.