This seems like a Swedish usage versus English usage. So just something to learn as an idiom of that language. I translated it correctly but I agree, I thought how does one swim along a beach. In the sand?! "I am swimming close to the beach so as to avoid a rip tide", perhaps. Swedish seems to be a more direct language and English wanders all over the place to make the same point. And I AM learning Swedish, so I get it. Just another funny phrase to an English speaker. My mom always said, when I asked what they were saying in Swedish, well this or that just does not translate well into English.