It happened to my iPhone 6, nine days out of warranty, on Monday. They explained it needed to be replaced, but is out of warranty. Technician spoke with his manager, and they replaced it with a brand new 6 at no charge. I was surprised, but pleased of course.
It was nice that they exchanged it. When my son took his in, they attempted to repair it. They then told my son if it wasn't fixed then he'd just have to buy a new phone. Of course, the problem was still there. He then opted to send it off to one of the phone repair outfits. We mailed it and they received it on last Friday and we got it back Monday. Works like new.