mbogh / NibDesignable

Elegant way of enabling IBDesignable on your nib-based views
MIT License
342 stars 74 forks source link

There is build error for Swift 4 #59

Open quytinypulse opened 6 years ago

quytinypulse commented 6 years ago

Swift doesn't allow overriding a method in an extension. The fastest way to fix is adding @objc to the method:

extension UIView {
    @objc public var nibContainerView: UIView {
        return self
    }
    /**
     Called in the default implementation of loadNib(). Default is class name.

     - returns: Name of a single view nib file.
     */
    open func nibName() -> String {
        return type(of: self).description().components(separatedBy: ".").last!
    }
}

I don't have permission to make a PR, so please help release new version including that update.

Thanks & Best Regards,