Post

Replies

Boosts

Views

Activity

Reply to SwiftUI List and ForEach
For the first error, you need to add an 'id' clause, like this: ForEach(menuItems, id: \.self) { menuLine in Here is an explanation of the reason for this (better than I could give): https://www.hackingwithswift.com/books/ios-swiftui/why-does-self-work-for-foreach For the second error, the ForEach statement needs to return a view, which print does not do. So you could include a Text within the ForEach, for example: Text(menuLine)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’24
Reply to VStack showing error. I'm unable to figure out why
I get this problem too. I tried using Group{} inside both of the VStacks in my SwiftUI module. But then that resulted in this error message: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions on this line: var body: some View { I'm creating a Feedback Assistant request for this.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
Reply to SwiftUI List and ForEach
For the first error, you need to add an 'id' clause, like this: ForEach(menuItems, id: \.self) { menuLine in Here is an explanation of the reason for this (better than I could give): https://www.hackingwithswift.com/books/ios-swiftui/why-does-self-work-for-foreach For the second error, the ForEach statement needs to return a view, which print does not do. So you could include a Text within the ForEach, for example: Text(menuLine)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’24
Reply to VStack showing error. I'm unable to figure out why
I get this problem too. I tried using Group{} inside both of the VStacks in my SwiftUI module. But then that resulted in this error message: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions on this line: var body: some View { I'm creating a Feedback Assistant request for this.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22