Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Is there any way to use this with an url instead of a local gif? #51

Open
stijnwesterhof opened this issue Feb 2, 2017 · 2 comments
Open

Comments

@stijnwesterhof
Copy link

No description provided.

@KrisYu
Copy link

KrisYu commented Feb 13, 2017

Yes, the UIImage can be created by UIImage.gif(data: Data)

Code would be something like this:

    let url = URL(string: url)
    let data = try? Data(contentsOf: url!)
    let gifImage = UIImage.gif(data: data!)
    imageView.image = gifImage

Just take care of two things:

  1. You may want to do it async.
  2. If load from http://, Remember add 'App Transport Security Settings' and set Allow Arbitrary Loads to Yes.

@PawanmSpaceo
Copy link

### You can use like this

imgViewGif.setGifFromURL(URL(fileURLWithPath: Bundle.main.path(forResource: "cameraGif", ofType: "gif")!), manager: SwiftyGifManager.defaultManager, loopCount: 1, showLoader: true)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants