If it's really stuck it works...being stuck is not the same as being finished. A beer can be stuck usually if the temp suddenly drops to the yeasts dormancy/flocculation point. So swirling warming does indeed work. Or rarely the yeast tires out, and swirling it back into suspension will help bring it down a few more points.
But what most new brewers think is a stuck fermentation is usually a matter of the yeast eating all the fermentables and finishing high, like what we call the 1.020 or 1.030 curse. If you mashed too high and got a lot of unfermentables, or in the case of extract, a lot of unfermentables/caramelization. Nothing you can do short of maybe adding an alpha amalaze to "break" the unfermentable sugars down will work.
Swirling won't, warming it up won't, heck even adding more yeast won't. A beer can be done high, and nothing's really wrong.
For example I have a barleywine that is FINISHED at 1.040. The og was 1.170 and it has a lot of caramel malts and extremely dark (50 year old) honey in it. That dark translates into unfermentable sugars. It's been multiply yeasted, and has been sitting in a tertiary for close to two years. Despite the numbers it is finished, NOT STUCK, there's just nothing left for the yeast to eat.