Visitor @goelakash says in a comment that it's not clear how swearing is involved, and asks whether a living person, a president, say, can be invoked merely by name in such a locution.
It's not swearing as in cussing (cursing) but as in telling the truth. The exclamation is a shortened form of By God, that is, an invocation of God to attest to the truthfulness of the utterance. We swear by something, for example, "by all that is holy".
God, it's hot today! or Jeez it's cold in here!
Speakers have long lost the sense that an oath is involved when using these exclamations. They are merely very strong emphatics and can express intense emotion, such as anger or dismay or alarm.
Jesus Mary and Joseph, what the f--k are you doing to my car!?
To swear by a living person or some other ad hoc entity, we need to use the preposition by.
By the Trump brand, I'm telling the truth, I say! The god's honest truth!
P.S. Speakers who consider such language truly offensive are a small minority. The speech of many people who are good and devout, and who are kind and charitable to others, is peppered with such "oaths". But on those occasions that require propriety most of them would rein themselves in.
P.P.S. I've spelled the word f--k only because the answer might get censored otherwise.