FORM PROBLEMS

Hello, good morning everyone, I want you to help me with something.

What happens is that I have inside a "Form" Ten "Section" When adding another "Section" I get an error that calls "Trailing closure passed to parameter of type 'FormStyleConfiguration" that does not accept a closure.

Everything works very well until he added another "section"

Help me please.

Answered by Claude31 in 788293022

That's a limit of SwiftUI: a view cannot have more than 10 subviews (here sections).

There is a workaround: group up to 10 sections in a Group

Form {
     Group {
         Section { }
         Section { }
         // up to 10 sections
     }
     Group {
         Section { }
         Section { }
         // up to 10 sections
     }
}

That's a limit of SwiftUI: a view cannot have more than 10 subviews (here sections).

There is a workaround: group up to 10 sections in a Group

Form {
     Group {
         Section { }
         Section { }
         // up to 10 sections
     }
     Group {
         Section { }
         Section { }
         // up to 10 sections
     }
}
FORM PROBLEMS
 
 
Q