The UK has voted to leave the European Union, with the official result declared by the Electoral Commission in Manchester. .