Skip to content

Commit

Permalink
-Todo Screen No Content View Bug Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
KhubaibKhan4 committed Dec 22, 2024
1 parent 1163f9c commit a03cd53
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
14 changes: 14 additions & 0 deletions Notes/data/Language.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Language.swift
// Notes
//
// Created by Muhammad Khubaib Imtiaz on 16/12/2024.
//
import SwiftUI

struct Language: Identifiable {
let id = UUID()
let name: String
let code: String
let icon: String
}
38 changes: 18 additions & 20 deletions Notes/todo/TodoScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,35 @@ struct TodoScreen: View {

var body: some View {
NavigationView {

VStack {
List {

if todoList.isEmpty {
VStack {
Spacer()
ContentUnavailableView("No Notes Found", systemImage: "text.document.fill", description: Text("There're no notes yet. Add a note to get started."))
.frame(maxWidth: .infinity, maxHeight: .infinity)
Spacer()
}
} else {
if !completedList.isEmpty {
Section("Complete Tasks") {
ForEach(completedList) { completeItem in
todoRow(for: completeItem)
List {
if !completedList.isEmpty {
Section("Complete Tasks") {
ForEach(completedList) { completeItem in
todoRow(for: completeItem)
}
}
}
}

if !inCompleteList.isEmpty {
Section("Incomplete Tasks") {
ForEach(inCompleteList) { item in
todoRow(for: item)
if !inCompleteList.isEmpty {
Section("Incomplete Tasks") {
ForEach(inCompleteList) { item in
todoRow(for: item)
}
}
}
}.refreshable {
print("Pull to Refresh Init")
}

}
}
.refreshable {
print("Pull to Refresh Init")
}
}

.toolbar {
ToolbarItem {
Button {
Expand Down

0 comments on commit a03cd53

Please sign in to comment.