I've seen some things that allow you to have more compile safety for initializing image assets, XIBs, and storyboards. I'd love to get more safety around loading assets. Anyone have any favorites?
Like loading views from nibs & vc from storyboard?
re: assets, I just use #imageLiteral
https://github.com/heshamsalman/ReusableViews#convenient-instantiation-of-a-view-from-a-nib
Hell ya, that鈥檚 exactly what I want to do.
Sent with GitHawk
using it in prod and it's been great for our needs
there are limitations:
using convenience dequeue methods that make cell instantiation safer requires registry of that cell even if it's a UITableViewCell. Using a special style of a cell like UITableViewCellValue1 requires a class that basically instantiates that way. Final caveat is that it only supports nibs that are used to house one view, and there isn't support for views that can instantiate from multiple nibs.
so basically if you have a nib structured like this:
MyNib:
| > ClassA
| > ClassB Contents
| ...
| > ClassB
| > ClassB Contents
there's no support for picking out ClassB through the convenience methods
That's weird, 2 classes in one xib? Who does that? 馃檯
SwiftGen looks awesome
Most helpful comment
using it in prod and it's been great for our needs
there are limitations:
using convenience dequeue methods that make cell instantiation safer requires registry of that cell even if it's a
UITableViewCell. Using a special style of a cell likeUITableViewCellValue1requires a class that basically instantiates that way. Final caveat is that it only supports nibs that are used to house one view, and there isn't support for views that can instantiate from multiple nibs.so basically if you have a nib structured like this:
there's no support for picking out ClassB through the convenience methods