title: Xcode UIView.init(frame:) must be used from main thread only
body: <p>I'm trying to render some views in background thread to not affect the main thread. That was never a problem before Xcode 9.</p>
  
  <pre><code>DispatchQueue.global(qos: .background).async {
      let customView = UIView(frame: .zero)
      DispatchQueue.main.async {
          self.view.addSubview(customView)
      }
  }
  </code></pre>
  
  <blockquote>
    <p>UIView.init(frame:) must be used from main thread only</p>
  </blockquote>
  
  <p>This error occurs in the second line.</p>
  
  <p><strong>Update</strong></p>
  
  <p>The Apple <code>UIView</code> Documentation actually says in the <em>Threading Considerations</em> section: </p>
  
  <blockquote>
    <p>Manipulations to your application’s user interface must occur on the main thread. Thus, you should always call the methods of the UIView class from code running in the main thread of your application. <strong>The only time this may not be strictly necessary is when creating the view object itself, but all other manipulations should occur on the main thread.</strong></p>
  </blockquote>