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.
(..) The crew are not to be harmed. Agreed. Go on, poppet, go! Walk the plank! Barbossa, you lying bastard! You swore she'd go free! Don't dare impugn me honor, boy. I agreed she'd go free, but it was you who failed to specify when or where. Though does seem a shame to lose (..)2003 Pirates of the Caribbean: The Curse of the Black Pearl