Universal code for iPhone and iPad