Skip to content

dheerajghub/Quotes-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A SwiftUI quotes browsing app powered by the Quotable API — built as a practical guide to MVVM networking in SwiftUI

Stars Forks Platform Swift SwiftUI


About

Quotes App is a fully functional iOS app that lets users browse, search, and discover quotes fetched live from the Quotable API. Built entirely in SwiftUI, this project is designed as a hands-on reference for intermediate iOS developers looking to understand how real-world apps handle networking, state management, and reactive UI patterns.

The entire build journey is documented on Instagram — broken into parts that walk through building the app from scratch.


Motivation

This project exists to answer a question that trips up most SwiftUI beginners: how do you wire a real API to a real UI without things falling apart?

It's a practical reference for:

  • Structuring networking with the MVVM pattern in SwiftUI
  • Using @ObservedObject, @Published, and @StateObject correctly (and understanding the difference)
  • Handling loading, success, and error states cleanly
  • Building a production-quality SwiftUI app end-to-end

Target audience: Intermediate iOS developers who know SwiftUI basics and want to level up with real networking patterns.


Tech Stack

Layer Technology
Language Swift 5.7+
UI Framework SwiftUI
Architecture MVVM
Networking URLSession + async/await
Data Quotable Free API
Dependency Manager CocoaPods
Build Tool Xcode 14+

Key Concepts Covered

MVVM Architecture — ViewModels own the networking and state logic; Views stay declarative and dumb. A clean separation that scales well.

@StateObject vs @ObservedObject — when to own a ViewModel vs reference one. This project demonstrates both in context so the distinction is obvious in practice.

@Published + ObservableObject — driving UI updates reactively from network responses without manual DispatchQueue.main wrangling.

REST Networking in SwiftUI — fetching, decoding, and propagating Codable JSON responses from the Quotable API into live SwiftUI views.

Loading & Error States — handling the full request lifecycle (loading spinner → success → error) in a reusable, composable way.


Repository Structure

Quotes-App/
│
├── Quotes.xcworkspace              ← Open this in Xcode (CocoaPods workspace)
├── Quotes.xcodeproj/               ← Xcode project file
│
├── Quotes/                         ← Main source directory
│   ├── App/
│   │   └── QuotesApp.swift         ← App entry point
│   │
│   ├── Views/                      ← SwiftUI screens & components
│   │   ├── HomeView.swift
│   │   ├── QuoteCardView.swift
│   │   └── ...
│   │
│   ├── ViewModels/                 ← ObservableObject ViewModels
│   │   └── QuotesViewModel.swift
│   │
│   ├── Models/                     ← Codable data models
│   │   └── Quote.swift
│   │
│   ├── Networking/                 ← API service layer
│   │   └── QuotesService.swift
│   │
│   └── Resources/
│       └── Assets.xcassets
│
├── Podfile                         ← CocoaPods dependency file
├── Podfile.lock
├── .gitignore
└── README.md

Note: The inner source structure above reflects standard SwiftUI MVVM conventions. Explore the Quotes/ directory on GitHub for the exact file layout.


Getting Started

Requirements

  • Xcode 14+
  • iOS 15+ deployment target
  • CocoaPods installed (sudo gem install cocoapods)

Installation

# 1. Clone the repository
git clone https://github.com/dheerajghub/Quotes-App.git
cd Quotes-App

# 2. Install CocoaPods dependencies
pod install

# 3. Open the workspace (not the .xcodeproj)
open Quotes.xcworkspace
  1. Select a simulator or connected device
  2. Hit Cmd + R to build and run

⚠️ Make sure to open Quotes.xcworkspace — not Quotes.xcodeproj — after running pod install.


Screenshots


Further Reading


Support

If this project helped you understand SwiftUI networking, a ⭐️ means a lot!

For questions or issues, reach out at dheerajsh123456@gmail.com

Buy Me a Coffee


© Dheeraj Kumar Sharma · 2026

About

Quotes App is quotes browsing app which is built with Quotable Free API completely in SwiftUI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors