A simple and modern To-Do List app for iOS, built with SwiftUI using the MVVM architecture. Easily manage your daily tasks with a clean and intuitive interface.
- Add new tasks with title and optional description
- Mark tasks as completed
- Delete tasks with swipe actions
- Persistent storage using UserDefaults
- Responsive UI with empty state handling
- Light and dark mode support
This project follows the MVVM (Model-View-ViewModel) pattern:
- Model: Defines the data structure for tasks (
TaskModel
). - ViewModel: Handles business logic and state management (
TaskViewModel
). - View: SwiftUI views for displaying and interacting with tasks (
TaskListView
,AddNewTaskView
, etc.).
ToDoList/
├── Model/
│ └── TaskModel.swift
├── View/
│ ├── ContentView.swift
│ ├── TaskListView.swift
│ ├── AddNewTaskView.swift
│ └── ReusableView/
│ └── EmptyContentSubView.swift
├── ViewModel/
│ └── TaskViewModel.swift
├── Resource/
│ └── Assets.xcassets/
└── ToDoListApp.swift
ToDoListTests/
└── ToDoListTests.swift
## Getting Started
### Prerequisites
- Xcode 15 or later
- iOS 17.0+
### Installation
1. Clone the repository:
```sh
git clone https://github.com/iOSYahoCode/ToDoList.git
cd ToDoList
- Open
ToDoList.xcodeproj
in Xcode. - Build and run the app on the simulator or your device.
- Tap the + button to add a new task.
- Swipe left on a task to complete or delete it.
- Completed tasks are shown with a strikethrough and faded color.
- All tasks are saved locally and persist between app launches.
Basic test scaffolding is provided in ToDoListTests/ToDoListTests.swift
. Add your own tests to ensure app reliability.
Contributions are welcome! Please open issues or submit pull requests for improvements and bug fixes.
Yaroslaw Homziak
This project was created as a simple demonstration of SwiftUI and MVVM best practices.