Used [weak self] in closures, in conjunction with guard let self = self else { return } early-exits, to prevent memory leaks (from retain cycles between strongly referenced objects)
Specified all variable types & function return types in all View Models, to optimize compiler (it won't have to implicitly figure out types)
Laid groundwork to test for memory leaks, using Swift Testing de-initializers (similar to XCTest's "tear-down"), as I explain in the question on Stackoverflow: https://stackoverflow.com/q/79135797/13368695
Will fix up current tests first, then implement this. For now, commented out #expects checks ("asserts" in XCTest terms):
[weak self]
in closures, in conjunction withguard let self = self else { return }
early-exits, to prevent memory leaks (from retain cycles between strongly referenced objects)structs
->final class
#expects
checks ("asserts" in XCTest terms):