title: Open another app by deeplink and get result on iOS
body: <p>I'm new on Swift. Thats why my question may be incorrect.</p>
  <p>So, I have two apps.</p>
  <p>On first app I click login button that opens second app by deeplink. This works fine, but I don't know how to return result from second app.</p>
  <p>First app:</p>
  <pre><code>// FIRST APP
  // After click action
  let url = URL(string: &quot;lg://loginapp.com/login&quot;){
      if #available(iOS 10.0, *){
          UIApplication.shared.open(url, options: [:])
      }else{
          UIApplication.shared.openURL(url)
      }
  }
  </code></pre>
  <p>I don't know how to wait for result and how to return it from second app.</p>
  <p>On second app I need to login user and return to first app token or something like this.</p>
  <p>Now code on my second app is just like this. But must close with returning rusult.</p>
  <pre><code>// SECOND APP
  let result = args[&quot;result&quot;] as? String{
      if #available(iOS 10.0, *){
          UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
      }else{
          UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
      }
  }
  </code></pre>
  <p>Please give me some directions.</p>