2021年4月7日星期三

SwiftUI Preview not working with Binding

import SwiftUI    struct PremiumStoreSheetView: View {      // MARK: - PROPERTIES      @Binding var didSelectPass: Bool            // MARK: - BODY      var body: some View {          VStack {              PremiumStoreNavigationView()                  .padding(.horizontal, 10)              ScrollView(.vertical, showsIndicators: false) {                  Spacer()                  PremiumStoreItemVIew(didSelectPass: $didSelectPass, premiumItem: premiumStoreItems[0])              }          }      }  }    // MARK: - PREVIEW  struct PremiumStoreSheetView_Previews: PreviewProvider {      @State static var didSelectPass = false      static var previews: some View {          PremiumStoreSheetView(didSelectPass: $didSelectPass)      }  }  

My Preview isn't working. Not sure what I am doing wrong

Diagnostics shows

missing argument for parameter 'didSelectPass' in call    ----------------------------------------    SchemeBuildError: Failed to build the scheme "BrainDrainExtreme"    missing argument for parameter 'didSelectPass' in call  
https://stackoverflow.com/questions/66996054/swiftui-preview-not-working-with-bindingbool April 08, 2021 at 09:08AM

没有评论:

发表评论