← Back to Website

SwiftUI + MVVM + Firebase: The Real Challenges Were Not the UI

2025
SwiftUI + MVVM + Firebase: The Real Challenges Were Not the UI

SwiftUI helped me move quickly—especially for building polished screens and interactions. But once I connected real data and real user flows, the toughest problems became architecture and state.

MVVM was my anchor. I separated Views, ViewModels, and services (Firebase Auth / Firestore). The goal was simple: keep the UI reactive, keep business logic testable, and avoid “god views.” The difficulty was deciding what belongs where as the app grows.

Firebase made it easy to start (auth, database), but I had to learn to design the data model early. When I changed Firestore structure too late, it created migration pain and UI bugs. A key learning: spend time upfront on data shape, indexing, and query patterns.

Auth and lifecycle edge cases were another pain: user logs out while a listener is active, network interruptions, stale cached state, and making sure the UI never shows inconsistent data. I started building “loading/empty/error” states intentionally instead of as an afterthought.

What I want to improve next: stronger verification and testing (unit + integration), and more robust offline-friendly behavior. The UI is the easy part; reliability is the product.