babylonhealth / Bento

Swift library for building component-based interfaces on top of UITableView and UICollectionView 🍱
MIT License
374 stars 11 forks source link

Adds AnyRenderableConvirtable #166

Closed TheAdamBorek closed 5 years ago

TheAdamBorek commented 5 years ago

I'd like to add AnyRenderableConvirtable into Bento.

Why?

In our main project, we need to have an array of AnyRenderable to be able to call .stack(...) method. Because of that, every element of the array has to have .asAnyRenderable() called at the end of its declaration. I'm just too lazy to do so every time.

With AnyRenderableConvirtable the Stack component can be responsible to call asAnyRenderable() on it's children :)

extension Array where Element == Optional<AnyRenderableConvirtable> { ... }