Swift Langauge version — Swift 5
Xcode: Version 12.2
This one is written when completing one of the challenge project of 100 days of SwiftUI by hackingwithswift. (https://www.hackingwithswift.com/100/swiftui/19)
Challenge was to create a simple length measurement app from scratch. User will input a length and choose input unit [meters, kilometers, feet, yards, or miles]. He will then choose output unit. App should show the converted unit in Text view.
Simple as it sounds! 👼
I am not going to talk about UI here, only the logical part.
When I started learning swift, first thing my mentor told me to follow best practices. And I never regret following his guidance.
So while doing one particular project which involved coordinator pattern, I came across one such problem. Not a huge problem, but a problem that matters. Specifying colour, images for views and cells. Question arises where to keep it and how easy it is to access.
Initially, I kept it in cell class since that colour and images was used only in that. But as project grew, things were repeated in so many cells and view controllers.
iOS developer at Robosoft Technologies