TextField wont allow Nil for objects that already exist but will for new objects

I have a SwiftData object Set that has a non Optional reps and Weight and when my editView gets initialized I Set the existing sets to a State object:

  @State var sets: [Set]

        .onAppear {
            //this will check if the exercise has sets and if it does we will put them into State but if its doesnt we will create 2
            // exercise = exercise
            if let newSets = exercise.sets {    //unwrapping the passed exercises sets
                if (!newSets.isEmpty) {     //we passed actual sets in so set them to our sets
                    sets = newSets
                }
                else {      //the exercise had no sets meaning an empty array was passed so we fill it with our mock Sets
                    sets = [Set(id: UUID(), weight: 0, reps: 0,isCompleted: false, exercise: exercise),Set(id: UUID(), weight: 0, reps: 0, isCompleted: false, exercise: exercise)]
                }
                sortSets()
                
            }
            //The optional exercise sets array was empty so load default sets into State
            else {
                sets = [Set(id: UUID(), weight: 0, reps: 0,isCompleted: false, exercise: exercise),Set(id: UUID(), weight: 0, reps: 0, isCompleted: false, exercise: exercise)]
                sortSets()
            }
        }

Then I iterate through this State of sets and bind the weight and reps to two TextFields:

                    ForEach($sets){ $set  in
                        //HStack for Editing the Details of a Set
                        HStack(spacing: 10) {
                            Group {
                                if(set.isCompleted) {
                                    Image(systemName: "checkmark.circle.fill")
                                        .foregroundStyle(.green) // Using the custom color
                                        .font(.system(size: 22)) // Adjust the size here
                                    
                                } else {
                                    Image(systemName: "circle")
                                        .font(.system(size: 22)) // Adjust the size here
                                }
                            }
                            .onTapGesture {
                                if(set.reps != 0 && set.weight != 0) {
                                    set.isCompleted.toggle()
                                }
                            }
                            //Enter Reps and Weight
                            HStack {
                                VStack(alignment: .leading){
                                    Text("Kg")
                                        .foregroundStyle(.gray)
                                        .font(.subheadline)
                                    //problem is here
                                    TextField("(set.weight)", value: $set.weight, formatter:Formatter.valueFormatter)
                                        .keyboardType(.decimalPad)
                                }
                                .frame(width: 45)
                                .padding(.leading)
                                //.background(.yellow)
                                
                                //Enter Reps
                                VStack(alignment: .leading) {
                                    Text("Reps")
                                        .foregroundStyle(.gray)
                                        .font(.subheadline)
                                    TextField("(set.reps)", value: $set.reps,formatter:Formatter.valueFormatter)
                                        .keyboardType(.decimalPad)
                                  
                                    
                                    
                                    
                                }
                                .frame(width: 45)
                                //.background(.blue)
                            }
                            
                            Spacer()
                            
                            //Button to dublicate the current set and add it to the list
                            Button {
                                print("Current sets count: (sets.count)")
                                if(sets.count <= 7) {
                                    let weight = set.weight
                                    let reps = set.reps
                                    let newSet = Set(id: UUID(),weight: weight, reps: reps, isCompleted: false, exercise: exercise)
                                    withAnimation {
                                        sets.append(newSet)
                                    }
                                }
                                
                                
                            }
                        label: {
                            Image(systemName: "plus.rectangle.on.rectangle")
                        }
                        .buttonStyle(.borderless)
                        }
                        
                        
                        
                    }

Now the problem is that If the Set already has a Weight and Reps I can’t set it to 0 to change it i.e it has 5 reps I want to change it to 6 I cannot clear the 5 to write 6 it wont allow it to be cleared, strangely enough when I add a new set in the New Set button:


Button {
                                print("Current sets count: (sets.count)")
                                if(sets.count <= 7) {
                                    let weight = set.weight
                                    let reps = set.reps
                                    let newSet = Set(id: UUID(),weight: weight, reps: reps, isCompleted: false, exercise: exercise)
                                    withAnimation {
                                        sets.append(newSet)
                                    }
                                }

It does not have that problem I can add and clear reps and weight as much as I want, why is that?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật