Göksel Köksal
Jul 21, 2018 · 1 min read

Hey Ali! The concept “push” belongs to UI layer so view model shouldn’t be responsible from triggering it, IMHO. MVVM has different implementations but I always design my view models to be UI agnostic so that they can be reused by different UI targets. For example, your watch target might not have a push action while your iOS app has it. View model should just notify listeners for data changes, and some other UI component like presenter or view controller should react to it. This way you can increase reusability and clearly separate UI logic from domain logic. Keep in mind that there is no right and wrong when it comes to software architecture though.

    Göksel Köksal

    Written by

    iOS developer. Serious gamer.