在我的应用程序中,我需要使用.gif
并且确实对其进行了搜索。每个人都要求使用UIImage.gifImageWithName("funny")
或UIImage.gifWithName("jeremy")
添加.gif
文件。但是我在这些上出错了Type 'UIImage' has no member 'gifWithName'
。如何解决这些问题以及如何.gif
在我的应用程序中使用。
从https://github.com/bahlo/SwiftGif/tree/master/SwiftGifCommon下载UIImage + Gif.swift文件并放入您的项目。
// An animated UIImage
let Gif = UIImage.gif(name: "jerry")
// A UIImageView with async loading
let imageView = UIImageView()
imageView.loadGif(name: "tom")]
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句