title: How to trigger action after x seconds in swiftUI
body: <p>I have been trying to accomplish two main goals that I'm having a headache with. Sorry if it's a simple fix, I am a still bit new to swift/swiftui</p>
  
  <ol>
  <li>trigger an action after a certain time has elapsed.</li>
  <li>trigger an <code>@State</code> to change value based on how much time has passed.</li>
  </ol>
  
  <p>I've searched through Stack Overflow and found answers suggesting to use a timer:</p>
  
  <pre><code>struct CurrentDateView : View {
      @State var now = Date()
  
      let timer = Timer.publish(every: 1, on: .current, in: .common).autoconnect()
  
      var body: some View {
          Text("\(now)")
              .onReceive(timer) {
                  self.now = Date()
              }
      }
  }
  </code></pre>
  
  <p>But how would I incorporate this so that something like <code>@State</code> can be used change my value to <code>false</code> after 7.5 seconds has passed:</p>
  
  <pre><code>@State randomTF : Bool = true
  </code></pre>
  
  <p>Or a  <code>Text("Please Enter Above")</code> to change to  <code>Text("Sorry Too Late")</code> after 7.5 seconds has passed</p>