Not sure about swimming in the sea (although DC’s never seem to mind!) but October is normally lovely, weather doesn’t tend to turn cold until Dec/Jan in Barcelona. We’ve been in October a couple of times and it is normally lovely and warm but no baking hot beach days.
In my experience Barcelona is roughly a month and a half difference. So expect it to be like early September uk (based on the south). After Christmas it's a month and a half better ( so more like early March in January). The sun is warmer so when it comes out, which it probably will in October you'll be in T shirts. The beach has quite a drop off so it's more paddling type stuff. Pools will be warm enough . Check because some places shut theirs. I go every January and I swim no problem outside. Not at all cold compared to Britian!