Skip to content

PREMSAIKVARMAOFFICIAL/InfoSys_13Sept25

Repository files navigation

InfoSys_13Sept25 — SwiftUI Assignment

Overview

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.

Project Structure

  • Models: City
  • Services:
    • CityService (fetch & cache with JSONDecoder.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)

Features

  • 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

Tech Stack

  • 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+

About

This app loads a JSON file of Australian cities and presents them in a collapsible, sectioned list grouped by state. It demonstrates MVVM architecture, SOLID design principles, dependency injection, caching, unit & UI tests, and supports both Light and Dark modes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages