Yes for first-hand contracts, which are impossible to get. So your options if you are not born into the first-hand contract queue (people put their 5 year old children on the queue) is to rent second-hand which was what I was doing.
The HOAs don't let you be a landlord and rent out your apartment for more than 2 years at a time, and you need to have a reason like you are moving to another country for studies.
Technically when you buy an apartment in Sweden you are (almost always) not actually buying the apartment, but rather just a stake in the HOA corporation with the attached right to live in the apartment. So the HOA has last say about who can live in the apartment (and what renovations you can do).
It is all very complicated and specific to Sweden, but this HOA corporation thing avoids a lot of fees/taxes when selling/buying the apartment (which is a BIG deal, stamp tax alone is 4% of the asset last I heard). But you get these downsides as well.
Detached houses usually don't have HOAs, those you can rent out more freely. However they are not exactly affordable housing, especially considering heating costs of detached houses triple during winter (maybe they only double _if_ you have modern heat pumps). Banks won't lend you money to buy real state with the intent to rent out either.