Adapted to XCode 6.1