Michael Long
Dec 12, 2023

--

The button was meant to be a self-contained favorite foods button.

Feel free to change the name to FavoriteFoodsButton and FavoriteFoodsService.

One could, if one wished, simply refactor the FavoritesButton to take a passed ObservableObject as a parameter, and then pass in a conforming service from a FavoriteFoodsButton view, or from a FavoritestoreButton view.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

No responses yet