I put a hair protector on my hair before swimming and wear a hat, use an anti chlorine shampoo and then my normal shampoo and conditioner. I take high dose vitamin E too for my nails and hair and because my hair is only a couple of inches long I think that's enough protection, the way it shines makes me think so too. Not all dyes are the same, plenty are oil based these days. My issue with swimming isn't my hair, it bleaches my eyebrows and eyelashes so they are virtually colourless. So now I also dye my eyebrows and lashes, well someone does those for me, eyebrows are no problem but lashes I don't want the dye in my eye so get them done professionally.
72 year old 5 year health check

I would never try it myself.