Mine had the same problem. I attempted to fix mine, but when I ordered and received the new switch, it didn't have the mounting hardware attached, so I wasn’t able to finish the repair. If you try to fix this yourself, make sure you get the switch WITH the hardware: '''iPhone 6 Audio Control Cable and Bracket'''
In my case, the surface-mounted switch on the printed circuit board was mechanically faulty. If seems the metal banding holding it together loosened, so it wouldn’t switch any longer without applying pressure from the backside.