title: what's the difference between the value changed and editing changed event of UITextField
body: <p>I am currently reading a book about design patterns in swift, and there is a program that a method get notified when a stepper's value changed or a text field associated with it changed, here is the method</p>
  
  <pre><code>@IBAction func stockLevelDidChange(sender: AnyObject) {
      println("Method Trigged")
          if var currentCell = sender as? UIView {
              while (true) {
                  currentCell = currentCell.superview!;
                  if let cell = currentCell as? ProductTableViewCell {
                      if let id = cell.productID? {
  
                          var newStockLevel:Int?;
  
                          if let stepper = sender as? UIStepper {
                              newStockLevel = Int(stepper.value);
                          } else if let textfield = sender as? UITextField {
                              if let newValue = textfield.text.toInt()? {
                                  newStockLevel = newValue;
                              }
                          }
  
                          if let level = newStockLevel {
                              products[id].4 = level;
                              cell.stockStepper.value = Double(level);
                              cell.stockField.text = String(level);
                          }
                      }
                      break;
                  }
              }
              displayTotalStock();
          }
  }
  </code></pre>
  
  <p>but I have some problems when change this thread of code, first when I just stripped out the while look, it just did not work.</p>
  
  <pre><code>@IBAction func stockLevelDidChange(sender: AnyObject) {
      println("Method Trigged")
          if var currentCell = sender as? UIView {
                  currentCell = currentCell.superview!;
                  if let cell = currentCell as? ProductTableViewCell {
                      if let id = cell.productID? {
  
                          var newStockLevel:Int?;
  
                          if let stepper = sender as? UIStepper {
                              newStockLevel = Int(stepper.value);
                          } else if let textfield = sender as? UITextField {
                              if let newValue = textfield.text.toInt()? {
                                  newStockLevel = newValue;
                              }
                          }
  
                          if let level = newStockLevel {
                              products[id].4 = level;
                              cell.stockStepper.value = Double(level);
                              cell.stockField.text = String(level);
                          }
                      }
                      break;
              }
              displayTotalStock();
          }
  }
  </code></pre>
  
  <p>and also, when I changed the text field's event from editing changed to value changed, it just don't work too!!!</p>
  
  <p>anyone knows what's going on there, thanks </p>