I heard Swansea comes from 'Swain's eye' a Norwegian Viking king who lost an eye in a battle against the Normans there... And it just seemed fit as its a seaside town. Anyway, I'm a bluebird so enough about them down the road ;) Cardiff is just as was said, a lazy attempt at Angloising the Welsh and it could be incorporating the river 'taff' which runs through the city although thia is unlikely as i's dont change from a's, apparently?!
-sea/-sey is quite a common ending in Viking era place-names. Nothing to do with eyes!
'Cardiff' is apparently quite close to an earlier Welsh pronunciation. The Welsh has moved on to the modern Caerdydd, but the English has stuck fairly closely to the much older pronunciation. (I can't remember the source for that, sorry.)
My understanding was that Swansea comes from Swain's (or Swayne's) Eyot. Eyot being the Viking or Anglo Saxon word for a small island. It is assumed that Swayne had a settlement on a small island at the mouth of the Tawe, possibly a trading post as the Vikings had quite a few all along the Welsh coast.
'Ey' is the old Norse word for island ('øy' in modern Norwegian and 'ey' in modern Icelandic), and it's usually the origin to lots of places that end in '-sea', '-sey', '-say' and '-sy'.
In the case of Swansea it's actually "Swan's ey" or "Svein's øy", pointing to an island in Bae Abertawe giving name to the whole area (Swansea bay - the bay surrounding Sveins ey, Svein's island).