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

[ad_1]

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: {
    ZStack{
        RoundedRectangle(cornerRadius: 30)
            .fill(Coloration("MediumLight"))
            .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))
            .foregroundColor(Coloration("Black"))
            .padding(.prime, 1)
            .multilineTextAlignment(.heart)
    }//ZStack
})//Button

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

ScrollView{
  LazyVGrid(columns: colums){
    ForEach(skins.skinproducts){skinproduct in
      VStack{
        ZStack{
            RoundedRectangle(cornerRadius: 20, model: .steady)
                .fill(Coloration("White"))
                .body(width: 160, top: 160)
                .padding(.prime, 20)
                .opacity(1)
            
            NavigationLink(vacation spot:
                            SkinDetailView(skinproduct2:skinproduct)
                .navigationBarBackButtonHidden(true)){
                    WebImage(url: URL(string:skinproduct.picture))
                        .resizable()
                        .aspectRatio(contentMode: .match)
                        .body(width: 120, top: 120)
        }
      }
   }

[ad_2]

Leave a Reply