Republican candidate Donald Trump has won two key swing states.