it's not really clear what you are asking. The following code
shows how you could navigate to "different views" from your list.
struct ContentView: View {
let contacts = [
Settings(imageName: "image1", name: "NumberOne"),
Settings(imageName: "image2", name: "NumberTwo"),
Settings(imageName: "image3", name: "NumberThree"),
Settings(imageName: "image4", name: "NumberFour"),
]
var body: some View {
NavigationView {
List(contacts) { contact in
NavigationLink(destination: NumberView(contact: contact)) {
ContactRow(contact: contact)
}
}
.navigationBarTitle("Contacts")
}.environment(\.colorScheme, .light)
}
}
struct ContactRow: View {
let contact: Settings
var body: some View {
HStack {
Image(contact.imageName)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 20, height: 20)
VStack(alignment: .leading) {
Text(contact.name)
.font(.system(size: 21, weight: .medium, design: .default))
}
}
}
}
struct Settings: Identifiable {
let imageName: String
let name: String
let id = UUID()
}
struct NumberView: View {
let contact: Settings
var body: some View {
Text("view: \(contact.name)")
}
}
Is this what you are looking for?