So my son has slept at night and for naps in a swing since he was 6 weeks old. The first six weeks he slept on one of us, but I have a bad hip, and just couldn't physically do it anymore. Swings for colicky babies are wonderful.
Here are some tips:
1) Get a good swing, one that is specifically made for infants/newborns.
Graco Sweetpeace swing or
Fisher Price cradle swing
Fisher Price Glider Swing
2) Get a White Noise noisemaker. We always played this when we put him in the swing, and then again if he starts to get fussy. If he's truly hungry, it won't make a difference.
3) Put plenty of padding and a good infant head insert in the swing. We have a soft fleece blanket and several quilted baby blankets for him to lie on. Boppy makes a good head insert.
3) At 20 weeks, we have now started to not swing him - and he is sleeping fine just in the swing without the movement. It took several nights of me waking up when he got fussy and turning on the white noise noisemaker . Now he sleeps in the swing his usual 6 or 7 hours (he's exclusively breastfed) without getting fussy without the movement. Our next goal is to move him to the bed. I'll let you know how that works out.
4) Most importantly, this swing needs to be beside your bed. You need to be there for your baby. Yes, the swing makes an annoying noise, but to me, its a small price to pay for everyone to get good sleep.