I'm following the tutorial here to display GIF image on UIImage
. I have write the extension UIImage+GIF.swift
which basically like this:
extension UIImage {
public class func gifImage(named: String) -> UIImage {
...
}
}
along with bunch other functions.
But when I tried to do this:
myImageView.image = UIImage.gifImage(named: "loading.gif");
Xcode complains type UIImage has no member "gifImage"
. Why? Any how can I fix this? Thanks.
EDIT:
I have also tried to make it a static function like this, but it still doesn't work:
extension UIImage {
static func gifImage(named: String) -> UIImage {
...
}
}