Updated for iOS 7 deprecation

This code updates lines that were deprecated in iOS 7.