“A special danger to morals is represented by public bathing at beaches, in pool and river banks… Mixed bathing between men and women, which nearly always is a proximate occasion of sin and a scandal, must be avoided.”
I have always thought that swimming with one's own sex is a great idea, for many reasons.
Plus: "Do they not see the harm resulting from excess in certain gymnastic exercises and sports not suitable for virtuous girls?"
Pius XII, 1954
"in gymnastic exercises and deportment special care must be had of Christian modesty in young women and girls which is so gravely impaired by any kind of exhibition in public."
Pius XI, 1929
We have really moved far away from this.