Hi,
I'm building a dynamic list, and I'm having trouble with the code. I had it working in Xcode 12 Beta, but the same code will not work in Xcode 11.
Xcode is prompting me to pass "senateData: [SenateData]", but when I do it fails to build with the message "Cannot convert value of type '[SenateData].Type' to expected argument type '[SenateData]'."
In Xcode 12 Beta is worked fine with me passing "senateData: senateData" but when I do it in Xcode 11, I get the message "Use of unresolved identifier 'senateData'."
Thank you in advance for your assistance.
I'm building a dynamic list, and I'm having trouble with the code. I had it working in Xcode 12 Beta, but the same code will not work in Xcode 11.
Xcode is prompting me to pass "senateData: [SenateData]", but when I do it fails to build with the message "Cannot convert value of type '[SenateData].Type' to expected argument type '[SenateData]'."
In Xcode 12 Beta is worked fine with me passing "senateData: senateData" but when I do it in Xcode 11, I get the message "Use of unresolved identifier 'senateData'."
Thank you in advance for your assistance.
Code Block import SwiftUI struct SenateList2: View { var senateData: [SenateData] var body: some View { List { ForEach(self.senateData, id: \.self) { senateData in HStack { Rectangle() .fill(Color(senateData.party)) .frame(width: 6, height: 26) .offset(y: 1) VStack(alignment: .leading) { Text("\(senateData.firstName) \(senateData.lastName)") .fontWeight(.medium) .font(.system(size: 14)) Text((senateData.party)) .font(.system(size: 12)) .font(.subheadline) .foregroundColor(.secondary) } Spacer() VStack(alignment: .trailing) { Text("\(senateData.senateClass) – Senator") .font(.system(size: 12)) .fontWeight(.medium) .font(.subheadline) Text((senateData.stateFullName)) .font(.system(size: 12)) .font(.subheadline) .foregroundColor(.secondary) } } } }.listStyle(GroupedListStyle()) } } struct SenateList2_Previews: PreviewProvider { static var previews: some View { SenateList2(senateData: [SenateData]) } }