title: Delegate didSet property of UIView not being called inside custom UITableViewCell
body: <p>I've been banging my head on the desk for the past 2 hours trying to figure this out so any help will be greatly appreciated. </p>
  
  <p>I'm using <a href="https://github.com/Mozharovsky/CVCalendar" rel="nofollow">CVCalendar</a> (the develop branch) and I'm trying to place the <code>CalendarView</code> inside a custom UITableViewCell so I can make it look something like this: </p>
  
  <p><img src="https://cloud.githubusercontent.com/assets/5099084/7671886/79abb6b0-fcae-11e4-8c68-01236138eb07.jpg" alt="fullpixels"></p>
  
  <p>The problem I'm facing is that it doesn't set the delegate property when I call <code>self.calendarView.calendarDelegate = self</code> inside the custom UITableViewCell</p>
  
  <p>I know it's not being set because I've placed a <code>println</code> inside the delegate <code>didSet</code> property that's not being outputted.</p>
  
  <p>Here is the CalendarViewDelegate outlet inside the CalendarView</p>
  
  <pre><code>// MARK: - Calendar View Delegate
  
  @IBOutlet weak var calendarDelegate: AnyObject? {
      set {
          if let calendarDelegate = newValue as? Delegate {
              delegate = calendarDelegate
              println("delegate did set property called")
          }
      }
  
      get {
          return delegate
      }
  }
  </code></pre>
  
  <p>Here is my code for the custom UITableViewCell I'm working with. </p>
  
  <pre><code>import UIKit
  
  class CalendarCell: UITableViewCell {
  
      var calendarView: CVCalendarView!
  
      override func awakeFromNib() {
          super.awakeFromNib()
          // Initialization code
      }
  
      override func setSelected(selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
  
          // Configure the view for the selected state
      }
  
      override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
          super.init(style: style, reuseIdentifier: reuseIdentifier)
  
          backgroundColor = UIColor.redColor()
          selectionStyle = .None
  
          self.calendarView = CVCalendarView(frame: self.frame)
          self.calendarView.calendarDelegate = self
          self.calendarView.calendarAppearanceDelegate = self
          self.calendarView.animatorDelegate = self
          contentView.addSubview(calendarView)
      }
  
      required init(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
  
      override func layoutSubviews() {
          super.layoutSubviews()
          self.calendarView.commitCalendarViewUpdate()
      }
  }
  </code></pre>
  
  <p>Here is my UITableViewController code: </p>
  
  <pre><code>import UIKit
  
  class CalendarTableViewController: UITableViewController {
  
      @IBOutlet var myTableView: UITableView!
  
      var items = ["Apple", "Banana"];
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          self.myTableView.registerClass(CalendarCell.self, forCellReuseIdentifier: NSStringFromClass(CalendarCell))
          self.myTableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "Cell")
          self.myTableView.dataSource = self
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      func creatHeaderCell() -&gt; UITableViewCell {
          var headerCell = self.myTableView.dequeueReusableCellWithIdentifier(NSStringFromClass(CalendarCell)) as! CalendarCell
          return headerCell
      }
  
      // MARK: - Table view data source
  
      override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -&gt; CGFloat {
          if (indexPath.section == 0) {
              return 300
          }
  
          return 44
      }
  
      override func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
          return 2
      }
  
      override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          switch (section) {
          case 0:
              return 1
          default:
              return items.count
          }
      }
  
      override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
          if (indexPath.section == 0) {
              return self.creatHeaderCell()
          }
  
          let cell = self.myTableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell
          cell.textLabel!.text = "Thomas"
  
          // Configure the cell...
  
          return cell
      }
  }
  </code></pre>