title: SWIFT : Prevent backup files on iCloud
body: <p><strong>How do I prevent iCloud backup in my app. For that I tried with NSFileManager.</strong> 
      And
  <strong>How to implement addSkipBackupAttributeToItemAtURL in Swift?</strong> </p>
  
  <pre><code>I tried with this stuff
  
  extension NSFileManager{
      func addSkipBackupAttributeToItemAtURL(url:NSURL)-&gt;Bool{
          var error:NSError?
          let success:Bool = url.setResourceValue(NSNumber.numberWithBool(true), forKey: NSURLIsExcludedFromBackupKey, error: &amp;error);
          return success;
      }
  }
  </code></pre>
  
  <p>But it gives me error : Extra argument error in call</p>
  
  <p>Now for calling the above function...</p>
  
  <p>NSFileManager.defaultManager().addSkipBackupAttributeToItemAtURL(NSURL.fileURLWithPath());</p>