I think it is caused by @ViewBuilder or because of the excessive nesting of such variables. But i do not know is it true or not. Can you please explain is it possible to stay this logic or not
<code>VStack {
TabView(selection: selectedTabViewBinding) {
ForEach(viewModel.state.tabItems.indices, id: .self) { index in
switch viewModel.state.tabItems[index] {
case .greetingPage:
greetingView *// here is the error *
case .profile:
fillingProfileView
}
}
}
.tabViewStyle(PageTabViewStyle())
}
private extension OnboardingView {
@ViewBuilder
var greetingView: some View {
NavigationStack {
VStack {
text
Spacer(minLength: 40)
VStack {
image
...
}
}
}
@ViewBuilder
var fillingProfileView: some View {
VStack {
Text("Create your profile") // сделать локализацию
Spacer(minLength: 20)
sections
}
}
...
</code>
<code>VStack {
TabView(selection: selectedTabViewBinding) {
ForEach(viewModel.state.tabItems.indices, id: .self) { index in
switch viewModel.state.tabItems[index] {
case .greetingPage:
greetingView *// here is the error *
case .profile:
fillingProfileView
}
}
}
.tabViewStyle(PageTabViewStyle())
}
private extension OnboardingView {
@ViewBuilder
var greetingView: some View {
NavigationStack {
VStack {
text
Spacer(minLength: 40)
VStack {
image
...
}
}
}
@ViewBuilder
var fillingProfileView: some View {
VStack {
Text("Create your profile") // сделать локализацию
Spacer(minLength: 20)
sections
}
}
...
</code>
VStack {
TabView(selection: selectedTabViewBinding) {
ForEach(viewModel.state.tabItems.indices, id: .self) { index in
switch viewModel.state.tabItems[index] {
case .greetingPage:
greetingView *// here is the error *
case .profile:
fillingProfileView
}
}
}
.tabViewStyle(PageTabViewStyle())
}
private extension OnboardingView {
@ViewBuilder
var greetingView: some View {
NavigationStack {
VStack {
text
Spacer(minLength: 40)
VStack {
image
...
}
}
}
@ViewBuilder
var fillingProfileView: some View {
VStack {
Text("Create your profile") // сделать локализацию
Spacer(minLength: 20)
sections
}
}
...
New contributor
user26878739 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.