SwiftUI app that lists Australian cities grouped by state (collapsible sections).
Implements MVVM, SOLID principles, dependency injection, caching, pull-to-refresh, and supports both light & dark mode.
Includes unit tests and UI tests with mock services for reliable coverage.
- Models:
City - Services:
CityService(fetch & cache withJSONDecoder.convertFromSnakeCase)CityServiceProtocol(abstraction for DI)InMemoryCityService(mock for UI tests)
- ViewModels:
CitiesViewModel - Views:
ContentView - Utility:
AppConstants(project-level constants, e.g. cache expiry) - Tests:
InfoSys_13Sept25Tests(unit tests with mock services)InfoSys_13Sept25UITests(UI tests with deterministic data)
- au_cities.json is bundled for offline fallback
- Collapsible sections grouped by state
- Reverse order button
- Dark & Light mode (uses system semantic colors, no hard-coded whites/blacks)
- Pull-to-refresh with
async/await - Cache data to disk until manual refresh or expiry
- Unit tests with mock service
- UI tests with stable accessibility identifiers
- MVVM + DI
- SOLID design principles for clean, scalable code
- Requires iOS 15+ (uses async/await)
- Language: Swift 5.9
- UI Framework: SwiftUI
- Architecture: MVVM, SOLID principles
- Testing: XCTest (Unit & UI tests)
- Minimum iOS: iOS 18+
- IDE: Xcode 16+