I made a library called Regift for converting movies to gifs on iOS. It's available on Github. Hopefully this helps you :)
If you install it, you can then do
Regift.createGIFFromURL(videoURL, withFrameCount: frameCount, delayTime: delayTime, loopCount: loopCount)
to create a gif.
It's best to check the full documentation, as I'll be keeping that up to date more than this answer.