swiftgif / SwiftGif

[UNMAINTAINED] 🌠 A small UIImage extension with gif support
MIT License
1.33k stars 306 forks source link

Unknown class GIFImageView in Interface Builder file. #92

Open dxshindeo opened 4 years ago

dxshindeo commented 4 years ago

So in storyboard I have an imageView, did set its class as "GIFImageView". When running app, the error in title is displayed.

Library installed as pod pod 'SwiftGifOrigin', '~> 1.7.0'

I also did a global search in the project Pods folder, and there are no results for a word "GIFImageView" - the class is not found in the library.

This is what I see:

Screenshot 2019-12-30 at 17 37 28

oscarito9410 commented 4 years ago

Hi, I'm not the library's owner, but in my case I created this simple @IBDesignableclass as below

import UIKit
import SwiftGifOrigin

@IBDesignable class GifImageView: UIImageView {

    @IBInspectable var imageGif: String = "" {
        didSet {
            sharedInit()
        }
    }

    private func sharedInit() {
        if !imageGif.isEmpty {
            self.loadGif(name: imageGif)
        }
    }
}