title: Write an iOS App review to disable ads for a day with Swift
body: <p>I have a "Rate App" popup and I was wondering if there was a way so that if a user clicks "Rate" then I can disable ads for a day. It would serve as an incentive for users to rate the app. Is this against Apple's terms of service?</p>
  
  <p>Heres my code in GameViewController</p>
  
  <pre><code>  func rateMe() {
      var neverRate = NSUserDefaults.standardUserDefaults().boolForKey("neverRate")
      var numLaunches = NSUserDefaults.standardUserDefaults().integerForKey("numLaunches") + 1
  
      if (!neverRate &amp;&amp; (numLaunches == iMinSessions || numLaunches &gt;= (iMinSessions + iTryAgainSessions + 1)))
      {
          showRateMe()
          numLaunches = iMinSessions + 1
      }
      NSUserDefaults.standardUserDefaults().setInteger(numLaunches, forKey: "numLaunches")
  }
  func showRateMe() {
      var alert = UIAlertController(title: "Rate Us", message: "Thanks for using Blocked", preferredStyle: UIAlertControllerStyle.Alert)
      alert.addAction(UIAlertAction(title: "Rate Blocked", style: UIAlertActionStyle.Default, handler: { alertAction in
          UIApplication.sharedApplication().openURL(NSURL(string : "itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&amp;id=&lt;iTUNES CONNECT APP ID&gt;")!)
          alert.dismissViewControllerAnimated(true, completion: nil)
      }))
      alert.addAction(UIAlertAction(title: "No Thanks", style: UIAlertActionStyle.Default, handler: { alertAction in
          NSUserDefaults.standardUserDefaults().setBool(true, forKey: "neverRate")
          alert.dismissViewControllerAnimated(true, completion: nil)
      }))
      alert.addAction(UIAlertAction(title: "Maybe Later", style: UIAlertActionStyle.Default, handler: { alertAction in
          alert.dismissViewControllerAnimated(true, completion: nil)
      }))
      self.presentViewController(alert, animated: true, completion: nil)
  }
  </code></pre>
  
  <p>And I am calling it in GameOverScene with this code:</p>
  
  <pre><code> let controller = self.view?.window?.rootViewController as! GameViewController
          if adLoaded == false {
          controller.showRateMe()
          }
  </code></pre>
  
  <p>Any help on how to implement this would be appreciated!</p>
  
  <p>EDIT:
  I'm thinking just making a bool and then setting it to true if they click rate app. Then have a timer that only starts if the bool is true, and it is a 1 day timer that runs a function that will set the bool to false. If the bool is false, then it will display ads. </p>
  
  <p>Would this work?</p>