title: 30 Minute Post Delay Not Working With Swift
body: <p>How do I create my program that will only allow users to post every 30 minutes using swift? This delay time only works if the app is running, besides that it will not work or restart the time running every time the app launches. I need a way to have them wait for only 30 minutes. My code right now is:</p>
  
  <pre><code>DispatchQueue.global(qos: .background) .async {
                  DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1800)) {
                      UserDefaults.standard.set(false, forKey: "PostTimeLimit")
                  }
              }
  </code></pre>
  
  <p><strong>Any tips or solutions would be very helpful. Thanks!</strong></p>