Пропустить навигацию
Have we talked about MVVM lately?
0:00 / 6:13

Have we talked about MVVM lately?

Sean Allen

@seanallen_dev70 тыс. подписчиков

Открыть в X
277 отметок «Нравится»СкачатьОригинальный пост

21 511 просмотров

Have we talked about MVVM lately?

12 комментариев

Комментарии из оригинального поста в X (Twitter)

  • Фото профиля Damjan Dabo

    @DamjanDabo

    It’s funny how most examples of moving away from MVVM still put important logic in the views, logic that really should be tested, but usually isn’t. Then again, for indie devs… who’s testing anyway? 😅

    14 отметок «Нравится»

  • Фото профиля Alex Fallah

    @itsfallah

    I’d like to see you talk about the pros and cons of mvvm. Besides “here’s a guy who made an article. This is trendy” “here’s a fancy code snippet”. Mvvm helps separate business logic from view logic. None of the code samples you show or in the article are great examples of it.

    7 отметок «Нравится»

  • Фото профиля MO

    @OlamiMorire

    No magic here. A lot of code requiring testing is basically just dumped in the View. Loading state can’t be unit tested; Snapshot test becomes more complex. This approach is similar to the original idea of just putting everything in a single file.

    2 отметки «Нравится»

  • Фото профиля Eric Ampire

    @eric_ampire

    the UI shouldn't have logic, the ViewModel or call it what you like is intended to ensure that the UI can only be responsible for displaying things on the screen that's all, by putting the logic in the UI, this logic becomes strongly coupled to the UI and reduces code reuse, as very often several UI components share the same logic.

    2 отметки «Нравится»

  • Фото профиля Kendall Gelner ᯅ

    @kendalldevdiary

    I also agree with this, from what I can tell this is a better approach.

    2 отметки «Нравится»

  • Фото профиля Alzea | Orenji Studio

    @helloalzea

    I don't care. MVVM rules!

    1 отметка «Нравится»

  • Фото профиля Dark Mouse Software

    @DarkMouseNET

    When you have a delegate (like didFinishPlayingAudio or didEnterRegion), do these still have to be used in a class? I've been creating the Class (I call AppManager), which I insert as an EnvironmentObject.

    1 отметка «Нравится»

  • Фото профиля Musca

    @muscabang

    Great idea to post snippet of your YouTube video here on X 👌🏻

    1 отметка «Нравится»

  • Фото профиля Himanshu Kumar

    @codewithimanshu

    Architectural patterns in codebases can bring elegance. When chosen well, they enhance maintainability and testability. This deserves ongoing discussion.

  • Фото профиля Lonnie Jordan

    @LonnieJordan843

    If you use UIKit then use MVVM. not necessary with SwiftUI.

  • Фото профиля Marc Stibane 📯

    @stibane

    "The magic is in the environment" - except that you cannot change an environment value, then use NvigationLink to push a new view on the stack, because for SwiftUI these are siblings - the pushed view is NOT a subview of the first and doesn't receive the changed value. Bummer!

  • Фото профиля Average European Citizen

    @avgeurocitizen

    Sean, MVVM is not an architecture, is a presentation pattern, it belongs in the presentation layer.