One has heard of countries where you should remove the PIN code of your phone when passing through airport security. Does this also apply to Sweden?
It's not necessarily that your phone will be checked therefore your pin code should not need to be removed. If so there is nothing suspicious about you removing your pin code there as you don't know if your phone will be checked.
Place your plastic bag with liquids in the tray so it is can be seen. Empty your pockets of mobile phones, keys and coins.
That is the only mention of phones and it doesn't say to get them ready for inspection or that they will be inspected.
I have been an exchange student in Stockholm for one year (in 2017-2018), it never happened to me and I have never seen / heard of it happening to anyone.
Note that I was travelling exclusively from and to Arlanda Airport and mostly from and to Geneva (Switzerland, in Europe but not EU), I passed the security checks about 10 times in total.
It can happen, but it's not a very thorough search at all.
It happened to me a few months ago after failing the x-ray. I had booze from an earlier trip still in the sealed bag which of course is very odd.
The officer asked for my boarding pass which I of course had in my phone. If I'd have had a physical one then my phone wouldn't have been checked.
I opened the airline app and showed the boarding pass. The officer then looked through my notifications and some of my text messages and noted that I had flown to XXX destination a few weeks back and then he handed me my phone back.
To prevent this one could either have a paper boarding pass or use the "lock app" feature in Android which will prevent anyone from switching apps.
The switching of apps could've been accidental.