title: How to open fb and instagram app by tapping on button in Swift
body: <p>How can I open Facebook and Instagram app by tapping on a button in <code>swift</code>? Some apps redirect to the Facebook app and open a specific page. How can I do the same thing?</p>
  
  <p>I found it:</p>
  
  <pre><code>var url = NSURL(string: "itms://itunes.apple.com/de/app/x-gift/id839686104?mt=8&amp;uo=4")
  
  if UIApplication.sharedApplication().canOpenURL(url!) {
    UIApplication.sharedApplication().openURL(url!)
  }
  </code></pre>
  
  <p>but I have to know the app <code>URL</code>. Other examples were in <code>ObjectiveC</code>, which I don't know =/</p>