title: How to Share on Facebook and Twitter App in Swift 3 without SDK
body: <p>I need to share some link on facebook and twitter app if installed in device on a button tap.I can share the same using Whatsapp (code is below).I want to know if i can do the same in facebook and twitter app also.</p>
  
  <pre><code>  @IBAction func whatsappbtn(_ sender: UIButton) {
  
      var str = "This is the string which you want to share to WhatsApp"
      str=str.addingPercentEncoding(withAllowedCharacters: (NSCharacterSet.urlQueryAllowed))!
      let whatsappURL = URL(string: "whatsapp://send?text=\(str)")
      if UIApplication.shared.canOpenURL(whatsappURL!) {
          if #available(iOS 10.0, *) {
              UIApplication.shared.open(whatsappURL!, options: [:], completionHandler: nil)
          } else {
              // Fallback on earlier versions
          }
      } else {
  
          self.delegate?.alerting(msg: "Please install Whatsapp and try again.")
  
      }
  
  }
  </code></pre>