This week's question comes from
Flo:
“Do you build multiplatform apps? If so, how do you structure the UI code?”
I love this question since it’s a challenge we’re likely all facing someday. After years of building apps, I’m now building new apps with multiplatform in mind from the start. Even if I don’t end up adding multiple platforms, I make sure I’m prepared.
Whether it’s business logic or UI code, it’s important to make components reusable. Ideally, I recommend starting with a few focused packages:
- CoreExtensions, a library containing extensions you often use
- CoreUI, containing brand colors and reusable UI components
- Networking, I love making these generic enough to reuse across multiple app projects
- Tracking, if you do tracking, you want to have a facade that receives all tracking events, distributing it to registered services
Having these from the start will already set you up for multiplatform development. Especially if you’re developing these packages with mutliple apps in mind, you’ll reduce the work required for setting up a new app project.
Want to have your question answered next week? Ask your question on LinkedIn or Twitter.