title: How to save a Stepper data to UserDefaults in SwiftUI?
body: <pre><code>    struct Test {
          
          @State private var steps = UserDefaults.standard.integer(forKey: &quot;steps&quot;) {
              didSet {
                  steps = UserDefaults.standard.integer(forKey: &quot;steps&quot;)
              }
          }
          
          var body: some View {
              Stepper(&quot;Go up or down: \(steps)&quot;, value: $steps)
                  .onChange(of: steps) { newValue in
                      UserDefaults.standard.set(newValue, forKey: &quot;steps&quot;)
                  }
          }
      }
  </code></pre>
  <p>Using <code>didSet</code> with a binding value doesn't call didSet method. Shouldn't it be called since the value is changing? So, I'm unable to save and show the saved value after this View is pushed back and forth from Navigation view. How should I solve this issue?</p>