Update example code for iOS 8.