mbogh / NibDesignable

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

Nested Nibs, Speed of instantiateWithOwner #26

Open semireg opened 8 years ago

semireg commented 8 years ago

I have a fairly complex view hierarchy in a UITableViewCell (among other things) that uses nested NibDesignables. On slower devices the load time is very noticeable. For example, with 2 NibDesignables each with 5 subviews that are NibDesignable, it takes approximately 2 seconds on the main thread. Profiler doesn't show a large CPU burden, though.

Thoughts? Are there any easy fixes to make this kind of hierarchy instantiate faster? If I can't fix this then I'm afraid I'll be forced back to writing all of my views/autolayout programmatically. :-(

mbogh commented 8 years ago

@semireg could you share some code?

It might be able to cache the nibs pr. class if it is not done by default.