Not very well known, but iOS screen recording is now baked into the Quicktime app: http://www.tekrevue.com/tip/record-iphone-screen-quicktime/
From there, you could export the results to a variety of formats. For gif, check out the app GifBrewery.
From there, you could export the results to a variety of formats. For gif, check out the app GifBrewery.