title: how can the UILabel become a CALayer and cause a crash?
body: <p>I've got a custom <code>UIView</code> of which several instances are created inside a loop:</p>
  
  <pre><code>let models = CDMyModel.MR_findAllSortedBy("position", ascending: true) as! [CDMyModel]
  
  for view in myViews {
      view.removeFromSuperview()
  }
  
  self.myViews.removeAll(keepCapacity: true)
  
  for model in models {
      let myView = MYFaqView(width: CGRectGetWidth(self.view.frame))
      myView.titleLabel.text = model.title
      myView.content.text = model.content
      myView.titleLabel.sizeToFit()
      self.scrollView.addSubview(myView)
      self.myViews.append(myView)
  }
  </code></pre>
  
  <p>I do sometimes see crashes in Crashlytics in the line with <code>myView.content.text = model.content</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/U5I3L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U5I3L.png" alt="enter image description here"></a></p>
  
  <p>According to the crash I assume it has something to do with memory, but I really don't know how the myView could have been released at that point.</p>
  
  <p>All this happens in <code>viewWillAppear:</code>. Could the removing before has to do something with this? But I assume everything happens on the main thread, so this shouldn't be a problem as well - I'm really stuck here.</p>
  
  <p>The crash happens on iOS 9.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>MyFaqView init method:</p>
  
  <pre><code>init(width:CGFloat) {
      self.width = width
  
      super.init(frame: CGRectZero)
  
      self.addSubview(self.titleLabel)
      self.addSubview(self.toggleImageView)
      self.addSubview(self.separatorView)
      self.content.clipsToBounds = true
      self.addSubview(self.content)
  
      self.translatesAutoresizingMaskIntoConstraints = false
      self.clipsToBounds = true
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>let content:UILabel = {
      let l = UILabel()
      l.numberOfLines = 0
      if let font = UIFont(name: "OpenSans", size: 14) {
          l.font = font
      }
      return l
  }()
  </code></pre>