Creating charging switch on iPhone charger
There are these devices, but I'm not sure where you'll find one now. You could also use a non-powered USB hub.

But in all honesty, iPhone lithium ion batteries won't be too damaged by continual charging, it's not like to old days of NiCad (Nickel Cadmium) batteries.