Added ifdef to support ios 7 sdk