Rewrite for iOS 8.