zenangst / Vaccine

:syringe: Vaccine - Make your apps immune to recompile-disease
Other
307 stars 18 forks source link

Feature swizzling for table and collection views #30

Closed zenangst closed 6 years ago

zenangst commented 6 years ago

This PR adds swizzled injection for collection and table view data source. It dramatically reduces the amount of Vaccine imports that you need in your project.

Collection and table views will now get automatic injection as setDataSource will be swizzled at run-time. It adds an observer for the regular injection notification and validates that it was the data source that is a part of the notification as it comes in. The observer is added to collection and table views but it will respond to the data sources being injected. That way, anytime you make a change to the data source, the collection or table view will reload its contents... and voila, live reloading.