I swim alot in summer both in pools and the ocean. I have 4b relaxed hair. The BEST way I deal with this is to get braids -- makes my life easier AND is better for hair health since in a protective style and is not being constantly manipulated. Now, I HAVE done a lot of swimming with my relaxed hair loose and bottom line, it's a lot of extra care and attention to keep it moisturized and prevent breakage. In both instances I always:
1. use a moisturizing conditioner on hair before entering pool/sea. I don't recommend oils, but suggest creamy leave-in moisturizers or washout conditioners, whatever you like - I like nexxus humectress for this purpose, my cheaper alternative is any cholesterol conditioner -- lightly coat hair from roots to ends.
2. after applying conditioner, wet hair thoroughly with regular water before entering pool or sea. If don't have time for the conditioner, at least wet hair first. By wetting first, the hair absorbs the "regular" water and thus less opportunity for the pool/sea water to be absorbed.
3. ALWAYS wash/rinse after pool/sea and apply a moisturizer. This will remove the "hard" chemicals in pools and the salts in sea. If swimming all day, I found using shampoo 3 or 4 times is too much, then I RINSE hair out with regular water each time I get out for a significant period -- just let regular water run over hair and that gets out some of the hard stuff. ALWAYS use shampoo at end of swimming sessions. Reasons swimming so rough on hair is because of the cheimicals/salts that's on the hair and my goal is always to limit how long it remains on my hair.
Finally, I don't use "swimmers" shampoo because they are simply too harsh for my hair -- I found that a regular moisturizing shampoo is tons better and leaves my hair softer, and more manageable than the special swimmers stuff.
If my hair is loose, I washing and moisturizer at all cost -- really difficult to maintain a straight style because I limit heat and so end up in buns or with a textured look because less hassle. With braids, just wash and go!