Skip to content

πŸ“ A clean and modern SwiftUI To-Do app using SwiftData and MVVM architecture. Includes local persistence and unit-tested ViewModel logic.

Notifications You must be signed in to change notification settings

Daztery/todoapp_swiftui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βœ… TodoApp

A simple, modern, and fully functional To-Do application built with SwiftUI, SwiftData, and MVVM architecture. This app allows you to add, edit, complete, and delete tasks, with all data persisted locally using SwiftData.


πŸš€ Features

  • Create new tasks with a title
  • Edit existing tasks by tapping on them
  • Mark tasks as completed/incomplete
  • Delete tasks with swipe
  • Responsive UI with SwiftUI
  • Persistent local storage using SwiftData
  • Architecture based on MVVM
  • Fully unit-tested ViewModel logic βœ…

🧱 Project Structure

TodoApp/
β”œβ”€β”€ Models/
β”‚   └── Task.swift
β”œβ”€β”€ ViewModels/
β”‚   └── TaskViewModel.swift
β”œβ”€β”€ Views/
β”‚   β”œβ”€β”€ TaskListView.swift
β”‚   └── TaskFormView.swift
β”œβ”€β”€ TodoApp.swift
β”œβ”€β”€ TodoAppTests/
β”‚   └── TaskViewModelTests.swift

πŸ›  Technologies

  • Swift 5.9+
  • SwiftUI 3+
  • SwiftData (local persistence)
  • MVVM
  • Unit Testing (XCTest)

▢️ How to Run

  1. Clone the repo:
git clone https://github.com/yourusername/todoapp.git
  1. Open the project in Xcode:
open TodoApp.xcodeproj
  1. Run on Simulator or a physical device

πŸ“¦ No third-party dependencies are needed


πŸ§ͺ Unit Testing

The ViewModel is fully tested with XCTest. To run tests:

  1. Select the TodoAppTests target
  2. Use Cmd + U to run all tests

Tested behaviors:

  • Add new task
  • Edit task title
  • Toggle completion
  • Delete task

πŸ“Œ Future Enhancements

  • Add task categories or priorities
  • Add due dates and reminders
  • Implement dark/light mode toggle
  • UI polish and animations
  • iCloud sync (optional)

About

πŸ“ A clean and modern SwiftUI To-Do app using SwiftData and MVVM architecture. Includes local persistence and unit-tested ViewModel logic.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages