Pod:

 pod 'SDWebImage/GIF'
 pod 'FLAnimatedImage', '~> 1.0'

swift代码:

import SDWebImage

...

let path = Bundle.main.path(forResource: "splash_animation", ofType: "gif")
        if let path = path {
            self.gifImageView.sd_setImage(with: URL.init(fileURLWithPath: path), completed: nil);
        }