synesthesia-it / Boomerang

Swift micro-framework for MVVM (Model-View-ViewModel) native applications.
MIT License
36 stars 10 forks source link

ViewModelCompatible / ViewModelCompatibleType #14

Closed stefanomondino closed 4 years ago

stefanomondino commented 5 years ago

ViewModelBindable has always be a confusing wording, since most of the times it's the ViewModel binding itself to a view (and not the opposite, if the view is not interacting directly with it's view model but only reading properties)

I suggest a new ViewModelCompatible protocol, with associated type for view model. We should use internally use ViewModelCompatibleType, without associated type, to use it independently from internal type, and then force implementations to explicitly declare which viewModel will be used.

This should lead to less as? typecasting.