title: How does one change the position of a Slider in SwiftUI?
body: <p>I am trying to update/set my slider value within a button press action.</p>
  
  <pre><code>        Button(action: {
              if self.questionNum == 1{
                  print("End")
              }else{
                  self.questionNum -= 1
  
                  //This line here is where the value is being set.
  
                  self.slider.value = self.model.answers[self.questionNum - 1] as! Double
  
                  print(self.model.answers)
                  print(self.slider.value)
                  self.questionOpacity = 0
                  self.model.currentQuestion = self.model.questions[self.questionNum - 1]
                  DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
                      withAnimation(){
                          self.questionOpacity = 1
                      }
                  }
              }
          }) {
              Text("Previous Question")
                  .font(.system(size: 25))
                  .fontWeight(.medium)
                  .foregroundColor(Color.white)
                  .multilineTextAlignment(.center)
          }
  </code></pre>
  
  <p>The slider value actually changes but the dial does not move or update to represent the new value. My Slider value is coming from an Observable object like this one:</p>
  
  <pre><code>class SliderVal: ObservableObject {
  
  var didChange = PassthroughSubject&lt;SliderVal,Never&gt;()
  var value = 50.0 {
     willSet {
      print(self.value)
   }
  }
  </code></pre>
  
  <p>The default value of the slider is set to 50 which is the middle, is there any way I can both set and update the slider value to values stored in my array? Outputting the slider value actually gives me the correct result so why is it that the slider dial is not moving/updating?</p>
  
  <p>Thanks</p>