UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

SOLVED: Group() to avoid 10 items limit inside a Form has stopped working with Xcode 14.1

Forums > SwiftUI

As it sounds in the title.

All my views using this trick to have the option to add more than 10 views on a parent one, as described here:

https://www.hackingwithswift.com/quick-start/swiftui/how-to-group-views-together

have stopped working. No change myself at all. Just updating to XCode 14.1 yesterday and "Trailing closure passed to parameter of type 'FormStyleConfiguration' that does not accept a closure" error everywhere when Group is used.

I've written to developer support. In the meanwhile, does anybody have the same problem? Is there another different way to avoid this limit without Group?

My God...

1      

It working as extpected. This works fine

struct ContentView: View {
    var body: some View {
        VStack {
            Group {
                Text("1")
                Text("2")
                Text("3")
                Text("4")
                Text("5")
                Text("6")
                Text("7")
                Text("8")
                Text("9")
                Text("10")
            }
            Text("11")
        }
    }
}

However if you have that many Views in a maybe you should be looking to refactor some view out and make subviews anyway.

1      

Even more: just adding Group { } anywhere and the error appears. So I can't use Group on any part of my app. Even with a minimal view. Even this throw errors 😳

import SwiftUI

struct test: View {
    var body: some View {
      Group {
        Text("Hello, World!")
        Text("Bye")
      }
    }
}

1      

Oh, my God. I've just found the problem. It is my fault 😅.

I have created a new entity on my model called "Group". And the problem is... evident: system mismatchs my entity name and Group SwiftUI object. 🥴

Changing my model entity name solved the problem. It was sooo strange...

Thanks anyway, Nigel for your orientations 🙏

1      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.