MVVM - or Bunny Ears

Model - View -- ViewModel

Model-View-ViewModel pattern - or the bunny ears paradigm - explained so poorly that you will go read a book about it.

In TDD.Academy episode 24 - MORE Reverse TDD we cover the Ultimate Portfolio App (by Paul Hudson - Hacking with Swift) with more tests of the ViewModel methods.


We decide to REVERSE TDD the delete() method.

Argument Label Parameter Name : Type

I had to go to the Swift Programming Language to figure out the proper words to call the parameter labels - which is not the proper words. It is an argument label; and a parameter name. The underscore is used to omit an argument label. And contrary to my previous belief it is not making the argument label optional.


And then there are defalut parameter values:
func someFunction(argLabel paraName: Int, argLabel2 paraName2: Int = 12) {}

see: https://docs.swift.org/swift-book/LanguageGuide/Functions.html

MVVM -- Bunny Ears

Here's some great logic on why you don't need the Bunny Ears pattern in SwiftUI.

Don't use MVVM in SwiftUI