title: Methods of programmatically creating UIView in Swift
body: <p>To create <code>UIView</code> programmatically, I can do it in two different ways. However, I have no understanding as to what the benefits or drawbacks are of each method and which is better.</p>
  
  <p>What are the differences of the two methods? And what do the <code>()</code> and <code>!</code> do differently?</p>
  
  <p>Any hints would be very appreciated. Thanks.</p>
  
  <hr>
  
  <p><strong>Code</strong></p>
  
  <pre><code>// Create UIView method 1
  
  var myView1 = UIView()
  
  
  // Create UIView method 2
  
  var myView2: UIView!
  </code></pre>