title: Xcode swift link to facebook page
body: <p>I have an app with a button that is suppose to open a Facebook page.  It checks to see if the user has Facebook installed and should open the page in the app.  If it is not installed, then it simply opens the page with Safari.  It is not working however.  I suspect it has something to do with the wrong address for it, if the user has Facebook installed:</p>
  <pre><code>var fbUrl = NSURL(string: &quot;fb://facebook.com/FacebookPageName&quot;)!
  var fbUrlWeb = NSURL(string: &quot;https://www.facebook.com/FacebookPageName&quot;)!
  
  if (UIApplication.sharedApplication().canOpenURL(fbUrl)) {
    // Facebook App installed
    UIApplication.sharedApplication().openURL(fbUrl)
  } else {
    // No Facebook App installed
    UIApplication.sharedApplication().openURL(fbUrlWeb)
  }
  </code></pre>