title: Pointer to pointer parameter in Swift function
body: <p>How do you do pointers to pointers in Swift? In Objective-C I had a function which I would call recursively so that I could keep track of the number of recursions, but I'm stumped as to how to achieve this in Swift.</p>
  
  <pre><code>NSNumber *recursionCount = [NSNumber numberWithInteger:-1];
  [self doRecursion:&amp;recursionCount];
  
  - (void)doRecursion:(NSNumber **)recursionCount {
      // I'm sure this is a terrible way to increment, but I have limited Objective-C experience
      // and this worked, so I moved on after failing to find a decent var++ equivalent :-(
      int addThis = (int)i + 1;
      *recursionCount = [NSNumber numberWithInt:[*recursionCount intValue] + addThis];
      [self doRecursion:recursionCount];
  }
  </code></pre>
  
  <p>In the process of cutting this sample down for this post, I've ended up creating a never-ending loop, but you get the idea on how I'm remembering the value with each recursion.</p>
  
  <p>Does anybody know how to do this in Swift? Thanks.</p>