Home > AI > IOS > SwiftUI >

Extra argument in call

Reason: at most 10 views are allowed in one level. If you use Group to group the 10 views, then you can have at most 100 views.

struct ContentView: View {
    @EnvironmentObject var home: HomeGlobal
    
    var body: some View {
        VStack {
            Group {
                Text("Large Title").font(.largeTitle)
                Text("Title").font(.title)
                Text("Title2").font(.title2)
                Text("Title3").font(.title3)
                Text("Headline").font(.headline)
                Text("SubHeadline").font(.subheadline)
                Text("Body").font(.body)
                Text("Callout").font(.callout)
                Text("Caption").font(.caption)
                Text("good").font(.caption2)
            }
            Group {
                Text("footnote").font(.footnote)
            }
        }
    }
}

Leave a Reply