To avoid losing your Swedish citizenship if you were born and/or live abroad, you can apply to retain it. You must do this after the age of 18 but before you turn 22.
Visit this link for more Information about Loss and Retention Swedish Citizenship - Sweden Abroad