title: How to Correctly handle Weak Self in Swift Blocks with Arguments
body: <p>In my <code>TextViewTableViewCell</code>, I have a variable to keep track of a block and a configure method where the block is passed in and assigned.<br>
  Here is my <code>TextViewTableViewCell</code> class: </p>
  
  <pre><code>//
  //  TextViewTableViewCell.swift
  //
  
  import UIKit
  
  class TextViewTableViewCell: UITableViewCell, UITextViewDelegate {
  
      @IBOutlet var textView : UITextView
  
      var onTextViewEditClosure : ((text : String) -&gt; Void)?
  
      func configure(#text: String?, onTextEdit : ((text : String) -&gt; Void)) {
          onTextViewEditClosure = onTextEdit
          textView.delegate = self
          textView.text = text
      }
  
      // #pragma mark - Text View Delegate
  
      func textViewDidEndEditing(textView: UITextView!) {
          if onTextViewEditClosure {
              onTextViewEditClosure!(text: textView.text)
          }
      }
  }
  </code></pre>
  
  <p>When I use the configure method in my <code>cellForRowAtIndexPath</code> method, how do I properly use weak self in the block that I pass in.<br>
  Here is what I have without the weak self: </p>
  
  <pre><code>let myCell = tableView.dequeueReusableCellWithIdentifier(textViewCellIdenfitier) as TextViewTableViewCell
  myCell.configure(text: body, onTextEdit: {(text: String) in
     // THIS SELF NEEDS TO BE WEAK  
     self.body = text
  })
  cell = bodyCell
  </code></pre>
  
  <p><strong>UPDATE</strong>: I got the following to work using <code>[weak self]</code>: </p>
  
  <pre><code>let myCell = tableView.dequeueReusableCellWithIdentifier(textViewCellIdenfitier) as TextViewTableViewCell
  myCell.configure(text: body, onTextEdit: {[weak self] (text: String) in
          if let strongSelf = self {
               strongSelf.body = text
          }
  })
  cell = myCell
  </code></pre>
  
  <p>When I do <code>[unowned self]</code> instead of <code>[weak self]</code> and take out the <code>if</code> statement, the app crashes. Any ideas on how this should work with <code>[unowned self]</code>?</p>