Skip to content

amitms07/AirFiAssessment

Repository files navigation

📰 AirFiAssessment - iOS News Panel App

A lightweight iOS application built using Swift, MVVM architecture, and CoreData for offline persistence. This app simulates a basic news panel experience with role-based access (Author/Reviewer) and sync-first data fetching.


Features

Role-based Login

  • Author: Login with username "Robert"

  • Reviewer: Login with any username except "Robert"

    image

Offline Support

  • All articles are stored in CoreData for full offline functionality.
  • App prompts to sync if no data exists.

Sync Button (Login Screen)

  • Fetches all article IDs and details (mock API).
  • Compares and merges local vs server data based on version.
  • Saves updated data locally and pushes back to server.
  • image

✅ News List Screen

🔹 For Reviewer

  • Grouped by Author name.
  • Supports pagination (5 articles at a time).
  • Checkbox to select articles.
  • "Mark Approve" button to append current user to the approvedBy list.
image

On Scroll image

For Author

  • Displays author’s own articles.
  • Shows short description and approval count.
image

Detail Screen

  • Tapping an article navigates to a detailed view.

  • image

✅ Auto Sync (Bonus)

  • Auto-syncs data on network reconnect.
  • Displays toast messages on network changes.

🧱 Tech Stack

  • Language: Swift 5
  • UI: UIKit + Storyboards + XIBs
  • Architecture: MVVM
  • Database: CoreData
  • Networking: Mock API simulation using closure + delay
  • Connectivity Monitoring: NWPathMonitor
  • Toast Alerts: Simple in-view UILabel fade animation

🔁 Mock API Behavior

Simulated via:

  • fetchArticleIDs() – returns a list of IDs
  • fetchArticle(by:) – returns full article data
  • updateArticles(_:) – prints the updated data to console

Usage

  1. Launch app
  2. Auto Sync when launching the app
  3. Click "Sync" to simulate data fetch
  4. Login as either Author (Robert) or Reviewer
  5. Explore articles and approve them as needed
  6. Use network toggling to observe auto-sync and toast alerts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages