I hope the doctor has good news for you. Cycling is supposed to be good for your knees, but I know a lot of cyclists (including me) who have caused knee problems by overdoing it or a bad bike fit. My knees were really bad when I was carrying 30-50 extra pounds. It just stunk until I got it off. I have had both "upstairs" and "downstairs" knee problems in the past, and I think the "downstairs" version responded well to PT. It was always tendonitis in my case. I did not have to strictly rest, but I had to avoid anything that caused pain for a while to let it calm down. The good news about swimming is that you get a more intense workout if you are a terrible swimmer. I can destroy myself dog paddling in a pool in <30 minutes. It is efficient and less painful, so it can be a win/win if you have to live with it.
I have always had joint pain, but it got really bad when I was carrying around extra weight from the pregnancy. Losing the weight is likely to help, but you might be able to change some things with your bike position in spin class if you want to keep spinning and your doctor oks it. I had pain returning to class after my daughter was born, and it was due to poor bike position and excessive resistance. Is it a small enough class that you can ask the instructor to take a look at your position on the bike before class? You are obviously differently shaped than you were before pregnancy, but you may have also lost (or gained) some flexibility requiring a change in your seat fore/aft position. I still ask an instructor to look at my bike position every once in a while just to see if I have something completely off. I can tell a lot by feel, but an experienced cyclist/instructor can tell much more by looking at me on the bike. Are you rocking in your seat when you pedal sitting down? Is your knee bending more than 90 degrees when you pedal? This kind of thing is actually really easy to see and somewhat hard to feel if you aren't used to it.
You might want to think about dropping your resistance a bit. When my knees are bothering me, I reduce my resistance slightly and pick up my cadence. I have been a cyclist for a long time, and I spent most of those years as a "grinder". That did some permanent damage to my knees. I look at spin classes as a great opportunity to learn to spin faster. I try to keep my cadence well above 80 (usually 90+). I live in a really hilly area, so this gives me a workout that I can't get outside. Training your body to maintain a higher cadence instead of pushing monster resistance is generally better for you anyway. If I am not thinking about it, my "flat road" cadence will be something like 75-80 rpm in class. If my knees are bothering me, I will adjust the resistance to get to a flat road cadence of 85-90 rpm and adjust up or down from there throughout class. If my knees hurt suddenly in class, I will back off on the resistance or stand up for a few minutes and try again when things feel better. You can still get a really tough workout this way, and you get a bit more cardio instead of strength.
Daughter born April 2009 at 35 weeks due to Class 1 HELLP