I may be the last person on Earth to know this but here goes...
For umpteem years I have been plugging my iPhone into the front of my desktop computer at night to charge. I have to take my dad to the doctor this morning so I had my phone charging last night. I grab it to go this morning and find the battery is around 20% and apparently it didn't charge.
There is a message on the screen saying to "Unlock phone to use accessories". Huh?
So a quick Google search returns that apparently Apple quietly released an update a while back that restricts the use of the Lightning port unless the phone is unlocked. It's called "USB Restricted Mode ". If you plug your phone into the wall to charge it won't really effect you but if you plug it into a computer or other device like I've been doing the restrictive mode can prevent charging. It's funny I never saw this in the "What's new" stuff that scrolled on my screen during recent updates.
Anyway, it is easy to turn off in Settings and return to normal use of USB devices but unfortunately I currently have to hit the road with a 20% battery.
Thanks Apple. :-(