title: Swift 4 ,must be used from main thread only warning
body: <p>When I using <code>Swift4</code>in <code>Xcode 9</code> gives me</p>
  <blockquote>
  <p>UIApplication.delegate must be used from main thread only</p>
  <p>.... must be used from main thread only</p>
  <p>UI API called from background thread Group</p>
  </blockquote>
  <p>Purple Warning.</p>
  <p>My codes;</p>
  <pre><code>var appDelegate = UIApplication.shared.delegate as! AppDelegate
  public var context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
  let prefs:UserDefaults = UserDefaults.standard
  var deviceUUID = UIDevice.current.identifierForVendor!.uuidString
  </code></pre>
  <p>Warning line is;</p>
  <pre><code>  public var context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
  </code></pre>
  <p>Another warning like this;</p>
  <pre><code> let parameters = [
                          &quot;tel&quot;: &quot;\(self.phone.text!)&quot;
                          ] as [String : String]
  </code></pre>
  <p>Gives</p>
  <blockquote>
  <p>UITextField.text must be used from main thread only</p>
  </blockquote>
  <p>Same error again..</p>
  <p>How can I fix it ?  Any idea ?</p>