I'm creating a framework where I want to do some animation with SwiftyGif. I have a gif file named "loading.gif" which I want to present. The problem I'm facing is to find the file within the framework.
When my screen loads I initialise the image view for the gif, but it I always get Error : Gif file loading.gif.gif not found in the log and the gif never shows...
override func viewDidLoad() {
super.viewDidLoad()
let gif = UIImage(gifName: "loading")
let imv = UIImageView(gifImage: gif)
imv.frame = CGRect(origin: .zero, size: containerView.frame.size)
imv.loopCount = -1
containerView.addSubview(imv)
// Do any additional setup after loading the view.
}
Even tried to search a path in the bundle but it always returns nil:
let path = Bundle(for: type(of: self)).path(forResource: "loading", ofType: "gif")
On my podspec i'm trying to add my .gif files on the resouce
s.resource = 'DeathStarCore/**/*.{xib,xcassets,gif}'
s.source_files = 'DeathStarCore/Source/**/*.swift'
What is the proper way to do gifs in a development pod?