mbogh / NibDesignable

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

Subclassing other base views #52

Open hollyschilling opened 7 years ago

hollyschilling commented 7 years ago

There are many different types of views that could be subclassed to make NibDesignable versions of them. The framework already includes many of them (UIView, UIControl, UITableViewCell, UITableViewHeaderFooterView, UICollectionViewCell, and UICollectionReusableView), but users may always have proprietary classes that may benefit from being subclassed.

Subclassing views within the framework is made trivial by the abstraction of NibDesignableProtocol and it's default implementation. However, the scoping of -setupNib() makes it difficult to do outside of that file. If the scope of that method were expanded to public (instead of fileprivate) it would greatly ease this task. Are there any obvious down sides to doing this?