Update for iOS 8 based on StackOverflow post.