I can only find one reference to an Elf actually swimming, from Unfinished Tales:
When Nimrodel fled from Lórien it is said that seeking for the sea she became lost in the White Mountains, until at last (by what road or pass is not told) she came to a river that reminded her of her own stream in Lórien. Her heart was lightened, and she sat by a mere, seeing the stars reflected in its dim waters, and listening to the waterfalls by which the river went again on its journey down to the sea. There she fell into a deep sleep of weariness and so long she slept that she did not come down into Belfalas until Amroth's ship had been blown out to sea, and he was lost trying to swim back to Belfalas. This legend was well known in the Dor-en-Ernil (the Land of the Prince), and no doubt the name was given in memory of it.
Unfinished Tales Part II: "The Second Age" Chapter IV: "The History of Galadriel and Celeborn"
In general Elves in Middle-earth were very enamoured of the Sea, but not because of any natural affinity to water; for them, the Sea represented the way to Elvenhome, their paradise. Their love was primarily spiritual.
The main exception are the Teleri, the great Elvish mariners, who had a very strong affinity towards the Sea:
But the Teleri remained still in Middle-earth, for they dwelt in East Beleriand far from the sea, and they heard not the summons of Ulmo until too late; and many searched still for Elwë their lord, and without him they were unwilling to depart. But when they learned that Ingwë and Finwë and their peoples were gone, then many of the Teleri pressed on to the shores of Beleriand, and dwelt thereafter near the Mouths of Sirion, in longing for their friends that had departed; and they took Olwë, Elwë’s brother, to be their king. Long they remained by the coasts of the western sea, and Ossë and Uinen came to them and befriended them; and Ossë instructed them, sitting upon a rock near to the margin of the land, and of him they learned all manner of sea-lore and sea-music. Thus it came to be that the Teleri, who were from the beginning lovers of water, and the fairest singers of all the Elves, were after enamoured of the seas, and their songs were filled with the sound of waves upon the shore.
The Silmarillion III Quenta Silmarillion Chapter 5: "Of Eldamar and the Princes of the Eldalië"
I haven't found any reference to them swimming, but it seems likely that they did.
Although questionably canon, n a very early draft (the earliest, in fact) of what would become The Silmarillion, the halfelven Eärendel is taught to swim by the Oarni (mermaids, basically); he takes to it well. His friend Voronwë (a full Elf) is explicitly called out as not being able to swim:
'The Oarni give to Eärendel a wonderful shining silver coat that wets not. They love Eärendel, in Ossë's despite, and teach him the lore of boat-building and of swimming, as he plays with them about the shores of Sirion.'
[...]
Eärendel was smaller than most men but nimble-footed and a swift swimmer (but Voronwë could not swim).
History of Middle-earth II The Book of Lost Tales Part 2 Chapter 5: "The Tale of Eärendel"