2019-11-22a few seconds read (About 98 words)How to use ForEach with ScrollView in SwiftUIIssue #517 Use ScrollView -> VStack -> ForEach -> Content 123456789101112131415161718192021222324struct SearchScreen: View { @State var searchObjects: [SearchObject] = [ SearchObject(name: "By name", search: { CountryManager.shared.search(byName: $0) }), SearchObject(name: "By calling code", search: { CountryManager.shared.search(byCallingCode: $0) }), SearchObject(name: "By domain", search: { CountryManager.shared.search(byDomain: $0) }), SearchObject(name: "By language", search: { CountryManager.shared.search(byLanguage: $0) }) ] var body: some View { ScrollView { VStack(alignment: .leading) { ForEach(searchObjects.enumerated().map({ $0 }), id: \.element.name, content: { index, searchObject in VStack(alignment: .leading) { Text(searchObject.name) .styleLabel() TextField(searchObject.textFieldName, text: self.$searchObjects[index].text) .styleTitle() self.makeButton(searchObject: self.searchObjects[index]) } }) } } }}#swiftUI