In most cases you will have to pay the entire cost for the care if you are not a Swedish resident. People from EU/EEA-countries are exempt from this rule. A patient with a EU-card is entitled to all care necessary related to her pregnancy. This includes the delivery, provided that the purpose for your stay in Sweden was not just to give birth.
You will find
Food advice for pregnant women
Swedes with foreign permanent residency
Swedish nationals without permanent residency in this country are subject to the same rules as foreign patients, see the information above.
Asylum seekers are entitled to the same maternal healthcare as Swedish residents. When seeking care, you will be asked to show the card given to you by the Swedish Migration Board, the so called LMA-card. The card is a temporary id-card, valid during the period when you are seeking asylum.
Patients without permission to stay in the country
The caregiver can give you more information regarding your rights and administrative routines. You can also get some information here: