title: Create a customized table view cell using swift
body: <p>I am following this tutorial <a href="http://www.raywenderlich.com/62435/make-swipeable-table-view-cell-actions-without-going-nuts-scroll-views" rel="nofollow noreferrer">http://www.raywenderlich.com/62435/make-swipeable-table-view-cell-actions-without-going-nuts-scroll-views</a> to create a customized table cell. But I am using swift instead of objective c.</p>
  
  <p>Here is my table cell view in swift.</p>
  
  <pre><code>protocol SwipeableCellDelegate {
      func buttonOneActionForItemText(itemText: NSString)
      func buttonTwoActionForItemText(itemText: NSString)
  }
  
  class MyTableViewCell: UITableViewCell {
      @IBOutlet weak var button1: UIButton!
      @IBOutlet weak var button2: UIButton!
      @IBOutlet weak var mytextLabel: UILabel!
  
      @IBOutlet weak var testLabel: UILabel!
  
      var delegate: SwipeableCellDelegate
  
      init(delegate: SwipeableCellDelegate) {
          self.delegate = delegate
          super.init()
      }
  
      required init(coder aDecoder: NSCoder) {
         // fatalError("init(coder:) has not been implemented")
          super.init(coder : aDecoder)
      }
  }
  </code></pre>
  
  <p>But it does not compile, I get error saying :</p>
  
  <p>MyTableViewCell.swift:38:9: Property 'self.delegate' not initialized at super.init call</p>
  
  <p>And if I get rid of "init(coder aDecoder: NSCoder)", I get error saying 
  'required' initializer 'init(coder:)' must be provided by subclass of UITableViewCell'.</p>
  
  <p>I have read this thread 
  <a href="https://stackoverflow.com/questions/25126295/swift-class-does-not-implement-its-superclasss-required-members">Class does not implement its superclass&#39;s required members</a></p>
  
  <p>about what to do in my required init(coder aDecoder: NSCoder).</p>
  
  <p>But I can't get the code to compile.</p>
  
  <p>I appreciate if someone can help me.</p>
  
  <p>Thank you.</p>