Updated for iOS 8 and Xcode 6.1