I feel your pain. I too like to wear my hair longish.
It is a problem that I have grappled with for years, the best solution I found was a very high ponytail topped with two swimming caps (one thin and stretchy, the other thicker)
Even this arrangement was not perfect as water still seeped in round the sides and my hair looked squashed. Sometimes I go in but try and keep me head out of water and also try to avoid being splashed. I do my rather sedate version of breaststroke with my head well above the water.
Not ideal, I know but it may give you some food for thought.