If you are visiting the UK, you can enter the country with either a Swedish passport or national identity card. The travel document should be valid for the whole of your stay.
From 1 October 2021, you will not be able to enter the UK with your national identity card unless you have a pre-settled or settled EUSS status. More information here.
If you are planning to study, work or stay for a long time you might need to apply for a visa prior to your travels. More information this via this link.
Find extended travel advice for the UK in the Swedish section.