title: Passing variable from view inside the class ObservableObject?
body: <p>i got this struct</p>
  <pre><code>struct Calendar: View {
     @State private var selectDate = Date()
          var body: some View {
  // my code 
  }
  Class fetchmydate: ObservableObject {
  func fetchmydata (){
  // i want to pass selectDate to here in &quot;dd-mm-yyyy&quot; format as string 
  }
  }
  }
  </code></pre>
  <p>the idea i want to pass the selectdate from the view into observedobject class and not vice versa, but in this format &quot;dd-mm-yyyy&quot; and as a string. and if i don't pass this selected date it says it can't read the selected date inside the function.</p>
  <p>i know it is somehow weird question but if it can't be done in logic (passing) then what do you suggest to pass the date data and thank you alot my friends.</p>