They 'swore' (an oath of) allegiance to the United States of America. [=they formally promised that they would be loyal to the United States of America]
He 'swore us to secrecy/silence'. [=he made us promise not to tell anyone his secret]
He was so disgusted by the election results that he 'swore off' politics for good.
(..) You think Jack did that, too? Why would he be going to these lengths? I don't know. But don't worry. I swore I'd keep you safe, and I will. indistinct announcement over P.A. Linc. Grey. (..)2018 Fifty Shades Freed