title: Using NSNumber numberWithBool in Swift
body: <p>I submitted my Version 2 of my app for review and it got rejected due to a high backup to iCloud - wasn't aware of this as I only have to pics in my app but anyway. Now I try to convert that code </p>
  
  <pre><code>NSError *error = nil;
      NSURL *databaseUrl = [NSURL fileURLWithPath:databasePath];
      BOOL success = [databaseUrl setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&amp;error];
      if(!success){
      NSLog(@"Error excluding %@ from backup %@", [databaseUrl lastPathComponent], error);
      }
  </code></pre>
  
  <p>to swift and I couldn't get it work... 
  This is what I have so far...</p>
  
  <pre><code>func excludeFromBackup() {
      var error:NSError?
      var fileToExclude = NSURL.fileURLWithPath("path")
      var success:Bool = fileToExclude?.setResourceValue(NSNumber.numberWithBool(true), forKey: NSURLIsExcludedFromBackupKey, error: &amp;error)
      if success {
          println("worked")
      } else {
          println("didn't work")
      }
  }
  </code></pre>
  
  <p>As you see, I fail with the numberWithBool Value.</p>
  
  <p>Can anyone help me? Did anyone convert it before?</p>
  
  <p>Thanks in advance...</p>