title: "Unexpectedly found nil while implicitly unwrapping an Optional value" on overrided init in custom UIView class
body: <p>I'm trying to make a simple reusable component (actually totally empty, just a background color to distinguish it), but when I try to use the IBDesignable decorator to make it showable in XCode Interface Builder editor, it gives me an error :</p>
  
  <pre><code>Failed to render and update auto layout status for AnnounceVC: The agent crashed.
  </code></pre>
  
  <p>This error seems to come from my XIB component, and its swift class.</p>
  
  <p>Here is my AnnounceBubbleView class code :</p>
  
  <pre><code>import UIKit
  @IBDesignable class AnnounceBubbleView: UIView {
      @IBOutlet var contentView: UIView!
  
      override init(frame: CGRect) {
          super.init(frame: frame)
          addSubview(contentView)
      }
  
      required init(coder: NSCoder) {
          super.init(coder: coder)!
      }
  }
  </code></pre>
  
  <p>When I go in the DiagnosticReports folder, and I find my crash, it gives me this :</p>
  
  <pre><code>Sleep/Wake UUID:       F0240558-7F85-40FC-ADCC-7E95493F1BAA
  
  Time Awake Since Boot: 2700 seconds
  Time Since Wake:       2300 seconds
  
  System Integrity Protection: enabled
  
  Crashed Thread:        0
  
  Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
  Exception Codes:       0x0000000000000001, 0x0000000000000000
  Exception Note:        EXC_CORPSE_NOTIFY
  
  Termination Signal:    Illegal instruction: 4
  Termination Reason:    Namespace SIGNAL, Code 0x4
  Terminating Process:   exc handler [3224]
  
  Application Specific Information:
  CoreSimulator 587.35 - Device: iPhone 8 (07FC5929-A66D-4560-8FBE-39DF290CD7EB) - Runtime: iOS 12.2 (16E226) - DeviceType: iPhone 8
  Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
  </code></pre>
  
  <p>I tried to use </p>
  
  <pre><code>required init?(coder: NSCoder) {
      super.init(coder: coder)
  }
  </code></pre>
  
  <p>But it gives me the same error, and XCode won't build if I don't put an Optional or Forced value.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>In the case where I delete the "addSubview" part, then the UIView is not my custom view, neither on the IB or in the iOS emulator. It's a blank empty UIView</p>
  
  <p>code:</p>
  
  <pre><code>override init(frame: CGRect) {
      super.init(frame: frame)
  }
  
  override required init?(coder aDecoder: NSCoder) {
      super.init(coder: aDecoder)
  }
  </code></pre>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>I don't instantiate it programmaticaly, I would like to be able to preview it in the Storyboard.</p>
  
  <p>Do you have any idea ?</p>
  
  <p>Feel free to help me improve my post if it's not clear enough, I'm kind of new to Swift and XCode.</p>