Form vs Vstack for SwiftUI for iOS

I'm building a View for account creation, and have a number of text fields (first name, last name, email, etc.). It seems like the natural choice is to embed these TextField() views into a Form, but given that Form is built on UITableView (as I understand it) it becomes challenging and requires some workarounds to add modifiers like .background() and have them perform the way I want them to. If, instead of embedding them in a Form, I just use a VStack, there's no problem.

So my question is, is there any reason I should put up with the trouble and use Form? Does it give me any added functionality? Is it considered bad or unclean code to not use Form? From what I can tell, there don't seem to be any real benefits, right?

So my question is, is there any reason I should put up with the trouble and use Form?

In my opinion, Form is a collection of bunch of styles or behaviors which Apple's designer thinks is appropriate for input forms. So, many of the modifiers do not work as expected for Form or components inside Form.

If you want to make many components customized, not using Form seems to be a practical way than hacking the implementation details.

From what I can tell, there don't seem to be any real benefits, right?

Form is a good container if you want to implement the default styles or behaviors. Seems you do not think it a real benefit, but not all developer would think as you do. One clear thing is, you can have your own opinion.

List is often buggy or at least imprévisible… Form may be a super List.

So, Form may (in present versions at least) suited for very simple forms. But if you want to keep some control of what's happening, VStack is probably safer.

The implicit idea of the Form is to provide semantic information about app structure that allows the use of screen readers, application of a set of styles, animations, font sizes etc that are HIG compliant, look nice and work well in a "form" context across Apple's various platforms. Which is a nice idea and could be a massive time saver, particularly if cross platform is needed.

Now the problem is currently (and I've not seen anything offlicial saying it should not be done and nor does it raise build or run time errors/warnings) as the 3rd party SwiftUI Companion app mentions "When using a custom control, results are undefined". Which very much agrees with my experience that it works brilliantly if using bog standard components and no custom animations. But try and embed any custom View and it will go spectacularly wrong at runtime in all sorts of weird and wonderful ways that are next to impossible to debug.

So, is it worth bothering with?

In my opinion, at the moment it really depends on the how easy (or not) it is to achieve the required data collection Form with totally standard control components vs the pain of implementing any custom cross platform support if Form is not used.

Form vs Vstack for SwiftUI for iOS
 
 
Q