implemented working iOS 7 solution
courtesy of Janos Homoki
Merge remote-tracking branch 'GitHub/master'