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.
- 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 β
TodoApp/
βββ Models/
β βββ Task.swift
βββ ViewModels/
β βββ TaskViewModel.swift
βββ Views/
β βββ TaskListView.swift
β βββ TaskFormView.swift
βββ TodoApp.swift
βββ TodoAppTests/
β βββ TaskViewModelTests.swift
- Swift 5.9+
- SwiftUI 3+
- SwiftData (local persistence)
- MVVM
- Unit Testing (XCTest)
- Clone the repo:
git clone https://github.com/yourusername/todoapp.git- Open the project in Xcode:
open TodoApp.xcodeproj- Run on Simulator or a physical device
π¦ No third-party dependencies are needed
The ViewModel is fully tested with XCTest. To run tests:
- Select the
TodoAppTeststarget - Use
Cmd + Uto run all tests
Tested behaviors:
- Add new task
- Edit task title
- Toggle completion
- Delete task
- Add task categories or priorities
- Add due dates and reminders
- Implement dark/light mode toggle
- UI polish and animations
- iCloud sync (optional)