ios – How one can do a primary filter performance for firebase database on buttonclick?


I am making an attempt to go looking by way of my database for a sure class of things with a primary filter performance with buttons.

This is my code up to now, however I might need to make the classes show on button click on:

My Button:

Button(motion: {
   //do search perform
}, label: {
        RoundedRectangle(cornerRadius: 30)
            .body(width: 100, top: 35)
            .padding(.prime, 1)
            .shadow(coloration: .grey, radius: 5, x: 0, y: 5)
        Textual content("ALL")
            .font(.customized("Livvic-SemiBoldItalic", measurement: 12))
            .padding(.prime, 1)

My content material for firebase info on the merchandise that should be displayed:

  LazyVGrid(columns: colums){
    ForEach(skins.skinproducts){skinproduct in
            RoundedRectangle(cornerRadius: 20, model: .steady)
                .body(width: 160, top: 160)
                .padding(.prime, 20)
            NavigationLink(vacation spot:
                    WebImage(url: URL(string:skinproduct.picture))
                        .aspectRatio(contentMode: .match)
                        .body(width: 120, top: 120)


Leave a Reply