For starters the use-case which was defined `UserDefaults` you can just use a property wrapper to make it easier. Then in your class you can do:
@Defaults(key: “usesDarkTheme”) var usesDarkTheme: Bool
Now it uses type erasure under the hood and call sites are cleaner.
For PoP, it’s kind of outdated. Better to use Value Oriented programming nowadays
What does hand in hand?
Addressing the specific example in the article we can do a lot better (without protocol oriented programming).
For most cases you aren’t going to even need PoP. And I would argue it REALLY depends on your usecase, and business requirements.
Strong arming and shoe boxing business requirements into specific architectures is the wrong approach, should be the other way around.
For starters the use-case which was defined `UserDefaults` you can just use a property wrapper to make it easier. Then in your class you can do:
@Defaults(key: “usesDarkTheme”) var usesDarkTheme: Bool
Now it uses type erasure under the hood and call sites are cleaner.
For PoP, it’s kind of outdated. Better to use Value Oriented programming nowadays