Fixed orientation issues in iOS 8

Added compatibility for iOS 8 and Xcode 6 while maintaining backwards
compatibility for iOS 7 to handle orientation changes