title: How do I change the variable "url" which is inside of a class by using a struct? in swift
body: <p>I'm new to swift and I cannot figure out how to change the url variable by inputting the Binding var url from the struct. I keep getting errors regardless of how I try it. Any help would v vvv appreciated</p>
  <pre><code>struct SearchView : View {
      
      @State var showSearchView = true
      @State var color = Color.black.opacity(0.7)
      **@Binding var url: String**
      @ObservedObject var Books = getData()
      
      var body: some View{
          
  
          if self.showSearchView
          {
              NavigationView{
                  
                  List(Books.data) {i in 
  ....}
  </code></pre>
  <hr />
  <pre><code>class getData : ObservableObject{
      
      @Published var data = [Book]()
      **var url** = &quot;https://www.googleapis.com/books/v1/volumes?q=harry+potter&quot;
      
      init() {....}
  </code></pre>