The under fire mayor has apologised for swearing at a journalist during a heated exchange related to Donald Trump.