Form Container in Swift UI

In the SwiftUI Essentials video, around the halfway mark they mention using a Form container element to wrap form elements in a structured list view. When I tried adding this to the Avocado Toast Swift UI file, I got an "Unresolved Identifier" error that it didn't recognize the Form struct. Is it just that we're in Beta 1 of XCode and that struct hasn't been added to SwiftUI yet?


- Scott

Accepted Reply

You need to install the latest version of XCode (as of 6/20 currently build 11M337n)

Replies

Same here. Evidently they're using a slightly different version other than the one published. 😉

Apparently SwiftUI Form is coming in Seed 2

You should get the same result by using


typealias Form = List


Since a list is rendering controls in a diffrent way.

E.g. a picker control becomes a navigation button with a detail view.

It doesn’t appear to be there, but a List with ListStyle of GroupedListStyle seems to give me that same look. I haven’t dug too deep into that presentation to see if there were other differences though.

Form has been added in beta 2, but it's currently only available on iOS (unlike List which is available on all platforms).

You need to install the latest version of XCode (as of 6/20 currently build 11M337n)