For anyone unable to fix this issue it is possibly NOT caused by software, and also may NOT be faulty hardware. Before trying any of the previously mentioned solutions I strongly advise that you take a VERY careful look into the Lightning port with a strong light.
The lightning port is very susceptible to shorting, even from fluff and other gunk. Anyone who has charged an iphone from an un-grounded electrical outlet will probably have experienced similar symptoms. Symptoms of a clogged Lightning port may include : White line across top of screen, screen unresponsive to touch, touch sensors appearing faulty and pressing different sections of the screen.
Gunk in the lightning if very likely if you store the phone in your pocket. Be VERY careful cleaning out the port. I used a cut down and thinned drinking straw and with a strong light spent 5 minutes carefully cleaning. Afterwards ALL my issues were resolved. Just be careful not to push dirt further into the phone.