Skip to content

sala7khaled/Todo-SwiftUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Todo App

A SwiftUI Todo app with dynamic lists, an About section, and external links. Designed to demonstrate modern SwiftUI patterns, including List (Swipe / Drag & Drop / Edit), Form, Inputs, sheets, navigation stacks, dynamic tabs, and custom button styles.



Features

  • Todo List

    • Dynamic list of tasks using @StateObject and Binding.
    • Supports deleting (swipe-to-delete), reordering (drag & drop), and editing tasks using TextField.
  • About Tab

    • Large title navigation using NavigationStack and .navigationBarTitleDisplayMode(.large).
    • Centered content with a bottom-aligned action button.
    • Modern capsule-styled button with right icon.
  • More Info Sheet

    • Opens as a sheet from the About button.
    • Navigation bar with inline title and top-right dismiss button.
    • Dynamically loads links (LinkedIn, GitHub, Linktree) from a @StateObject view model.
    • Buttons open external URLs.
    • Supports modern SwiftUI styling (bordered-prominent buttons, capsule shapes, and tint colors).
  • Dynamic TabView

    • Tabs defined by an AppTab enum.
    • Easy to add new tabs.
    • Supports icons, titles, and views dynamically.
  • Responsive UI Tips

    • GeometryReader used for relative sizing.
    • Spacer() used for centering content and pinning buttons.
    • Fixed vertical/horizontal spacing via Spacer().frame() or VStack/HStack spacing.
    • SF Symbols or custom asset images for icons.


Screenshots

Todo List Edit Detail About Links


SwiftUI Patterns Used

  1. Binding Extensions
    .onChange and .onEmpty to react to changes in a Binding.
func onChange(_ handler: @escaping () -> Void) -> Binding<Value> {
  Binding(
      get: { wrappedValue },
      set: {
          wrappedValue = $0
          handler()
      }
  )
}
func onEmpty<Wrapped>(_ defaultValue: Wrapped) -> Binding<Wrapped> where Value == Wrapped? {
    Binding<Wrapped>(
        get: { wrappedValue ?? defaultValue },
        set: { wrappedValue = $0 }
    )
}


  1. Dynamic Tabs with Enum
enum AppTab: Hashable, CaseIterable {
    case todoList
    case about

    var icon: String { ... }
    var title: String { ... }
    @ViewBuilder var view: some View { ... }
}

About

A SwiftUI Todo app with dynamic lists, an About section, and external links. Designed to demonstrate modern SwiftUI patterns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages