Where do I put a link in this code?

I've spent soooooooo much time trying to work this out and I still have NO IDEA how to do this......

Where do I put the button or navigation link or ontap gesture to make my items (Humanity, Globel, et cetera) clickable so that they show a new screen?

Can someone pleeeeeaaaaase help me?

This code comes from SwiftUI Tutorial: Searchable. Create a search bar with only few lines… | by Arc Sosangyo | Geek Culture | Medium

import SwiftUI

struct ContentView: View {
    
    @State var searchCollection = collections
    @State private var searchText = ""
    
    var body: some View {
        
        NavigationView {
          
            List(searchCollection) { index in
			
				//Button("Button 1") { }
			
                ImageLabelRow(collection: index)
				
            }
            .navigationTitle("Title")

        }
        .searchable(text: $searchText, placement: .navigationBarDrawer(displayMode: .always))
        .onChange(of: searchText) { index in
        
    if !index.isEmpty {
        searchCollection = collections.filter { $0.name.contains(index) }
    } else {
        searchCollection = collections
    }
}

    } //body
    
} //ContentView

struct Collections: Identifiable
{
var id = UUID()
var name: String
}

var collections = [
Collections(name: "Humanity"),
Collections(name: "Global"),
Collections(name: "Energy"),
Collections(name: "Nature"),
Collections(name: "Weather"),
Collections(name: "Travel"),
Collections(name: "Video Games"),
Collections(name: "Health"),
]

struct ImageLabelRow: View {
    
    var collection: Collections

    var body: some View {
        HStack {

            Text(collection.name)
            //.font(.system(.largeTitle, design: .rounded))
            //.fontWeight(.black)
        }
    }
    
}

You should ask this question on the Apple Developer Forums.

This forum is only for matters related to Swift. :slight_smile:

Not Swift?

At Swift - Apple Developer

It says...

"Swift is a powerful and intuitive programming language for iOS, iPadOS, macOS, tvOS, and watchOS."

And at

https://forums.swift.org/

It says...

"Using Swift
This area is intended for users to get help with or ask questions about Swift or its related tools. Beginner questions welcome!"

So can you give me some more information please?

Your question is about SwiftUI, a user interface framework. It has been build using Swift but is a different thing than the programming language Swift.

You'll find plenty of basic tutorials about NavigationViews and NavigationLinks in Apple's developer site, as well as numerous other places (Hacking with Swift etc). See, e.g. this: Develop apps for iOS | Apple Developer Documentation

It has been build using Swift but is a different thing than the programming language Swift.

So let me get this straight...

My Swift (the programming language that can and is used to make UIs) is different to the programming language Swift.

Wow, I never knew that I was dealing with a chameleon progamming language.

How exciting!

You got any other pearls of wisdom?