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 couldn't find him. That's what it means to lose something. Now he's come back and taken Riverrun. I don't think it's fair to blame us... For years we kissed Tully boots, swore oaths to them and their stinking fish banners. Not again. Riverrun is ours. Take it back! We don't have the men. (..)2016 TvShow: Game of Thrones Title: Blood of My Blood Season: 6 Episode 6