Is it pooping? If so is the poop grey and stringy? How long have you had it?
Mostly can you put it in an isolation tank?
It could be a bacterial infection or a case of worms, since it is not eating medicated foods won't work. If you can isolate it you could try a couple of meds, If the feces are clear, gray, white and stringy it is bacterial so try a sulfa based med or metronidazole.
If there are any worms in the feces, or protruding from the vent, Especially when the tank is dark try praziquantel or paracide-D.
You say it is swimming funny, do you mean just labored swimming or does it list to one side or swim at an odd angle? The latter two generally mean bacteria, the othe can be either. Bacterial infections are more common so try treating for that first, the meds kill off filter bacteria which is one reason to put it in an isolation tank with mechanical fitration. Don't treat with both meds at the same time.
Do read and follow the package instructions, especially any cautions concerning scaleless fish.