title: View does not appear when made into its own custom view class
body: <p>I'm making a simple view programatically in Swift and I have this first code that is working just fine:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
      override func viewDidLoad() {
          super.viewDidLoad()
  
          view.backgroundColor = .darkGray
  
          let card:UIView = UIView()
          card.frame = CGRect(x: 38, y: 120, width: 300, height: 300)
          card.backgroundColor = .white
          card.layer.cornerRadius = 10
          card.layer.shadowOpacity = 0.5
          card.layer.shadowOffset = CGSize(width: 0, height: 10)
          card.layer.shadowRadius = 10
  
          view.addSubview(card)
      }
  }
  </code></pre>
  
  <p>This code make this view:</p>
  
  <p><img src="https://i.stack.imgur.com/m14Fd.png" alt="enter image description here"></p>
  
  <p>But I want to reuse the card so I put it into a new class like a custom view, but the card now disappears:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
      override func viewDidLoad() {
          super.viewDidLoad()
  
          view.backgroundColor = .darkGray
  
          let card = Card(frame: CGRect(x: 38, y: 120, width: 300, height: 300))
  
          view.addSubview(card)
      }
  }
  
  class Card:UIView {
      var box:UIView = UIView()
  
      override init(frame: CGRect) {
          super.init(frame: frame)
          setupLayout()
      }
  
      func setupLayout(){
          box.backgroundColor = .white
          box.layer.cornerRadius = 10
          box.layer.shadowOpacity = 0.5
          box.layer.shadowOffset = CGSize(width: 0, height: 10)
          box.layer.shadowRadius = 10
  
          addSubview(box)
      }
  
      required init?(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
  }
  </code></pre>
  
  <p>Do you know what is wrong with the second code?</p>