Hi everyone! π Letβs catch up on my coding journey.
Before today, I set up some basics:
1οΈβ£ Swiftlint for neat code. π οΈ
2οΈβ£ I split the project into parts: recipe searching, shared UI, and network stuff. π―
3οΈβ£ I also used Dependencies to keep track of my DI (short for Dependency Injection). π§©
After that, I was ready to jump into the real work!
My Task Today π
My goal was to build the first version of recipe searching with Test-Driven Development (or TDD). π§ͺ Hereβs what I did:
π I made a simple UI with a search bar and a list of recipe suggestions.
π§ͺ I wrote two unit tests:
- One to make sure recipes are filtered correctly by the search keyword.
- The other to check the ViewModel (where I moved all the display stuff out of SwiftUI View).
π With Dependencies, I can choose the version I need for preview, test, or live run.
What Did I Learn? π
βοΈ Start TDD from the outside (the dependencies) and move inward (toward the ViewModel).
π Drawing the flow and functionalities on paper helps me understand what to test.
π I should write down all the tests I need before adding testing logic.
And here are my sketches and plans:
Thatβs all for today, folks! Canβt wait to share more soon. Happy coding! π©βπ»π¨βπ»