title: Opening Instagram App in Swift, with a custom URL Scheme
body: <p>There's a button in my project that opens Instagram when tapped. The problem is I need this button to open Instagram, and if the user was <em>in the middle of</em> editing a photo, it takes them right back to the photo editing tab.</p>
  
  <p>With my code below, the button takes the user to Instagram's main feed. If they were in the middle of editing a photo, it clears that out.</p>
  
  <p>Is there a custom URL scheme that will open Instagram, without 'erasing' any progress the user was currently working on? EG - writing their image description, or editing their image with filters.</p>
  
  <p>// Instagram button pressed:</p>
  
  <pre><code>let urlStr: String = "instagram://app"
  let url = URL(string: urlStr)
  if UIApplication.shared.canOpenURL(url!) {
      print("can open")
      if #available(iOS 10.0, *) {
          UIApplication.shared.open(url!, options: [:], completionHandler: nil)
      } else {
          UIApplication.shared.openURL(url!)
      }
  }
  </code></pre>
  
  <p>I also tried <code>"instagram://"</code> and <code>"instagram://camera"</code> - but the problem persists of clearing out the screen that the user was currently working on.</p>
  
  <p>Thanks in advance</p>