rollback and fix to support both iOS 8 and iOS < 8, on Xcode 6 & before
add support for iOS 7
fix for compiling in Xcode 5