You can create GIFs using the ImageIO framework, which is part of the iOS SDK. You do not need ImageMagick or any other third-party library.
See this answer for code that uses ImageIO to create animated GIFs. If you don't want an animated GIF, just add a single image instead of a bunch of images.
Regarding the selection of images from the library, there are already many questions about stackoverflow about this. Just find [iphone] pick image from library .
rob mayoff
source share