Updated for Xcode 5 and iOS7