iOS8 support (idea & code courtesy of palxex, not tested).