Skip to content

jasontcs/SwiftCafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift Cafe

An iOS SwiftUI App using MVVM (Model-View-ViewModel) pattern & Combine Framework, support iOS14+

Features

  1. Authentication
  2. RESTful API Products Menu
  3. Core Data Shopping Cart

Screenshot

Login Page Menu Page Cart Page

Tech Stacks

  • UI: iOS SwiftUI
  • Design Pattern: MVVM (Model-View-ViewModel)
  • Async Operations: Async / Await & Combine to prevent callback hell & make the code clean

Project Structure

SwiftCafe
├─ Assets.xcassets
│  └─ CafeThemeColor.colorset   # App Colors
├─ Models                       # Data Models struct
│  ├─ AuthModel.swift
│  └─ ProductModel.swift
├─ Repositories                 # Business Logic Repositories
│  └─ CafeRepository.swift
├─ Services                     # Data API
│  ├─ CoreDataService.swift
│  └─ NetworkService.swift
├─ SwiftCafeApp.swift           # SwiftUI App Life Cycle
├─ ViewModels                   # ViewModel for each View
│  ├─ CartViewModel.swift
│  ├─ LoginViewModel.swift
│  ├─ MainViewModel.swift
│  └─ MenuViewModel.swift
└─ Views                        # Contains a ViewModel per View
   ├─ CartView.swift
   ├─ LoginView.swift
   ├─ MainView.swift
   └─ MenuView.swift

Architecture - MVVM Pattern

About

iOS SwiftUI App using MVVM & Combine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages