title: How to share text of a label from iPhone app to facebook?
body: <p>I have written a simple Xcode project in swift for my iPhone . I am trying to send the text of my label to facebook using facebook share option .</p>
  
  <p>Below is my code </p>
  
  <pre><code> import UIKit
  import Social
  
  class ViewController: UIViewController {
  
    @IBOutlet weak var musicDescription: UILabel!
  
    override func viewDidLoad() {
      super.viewDidLoad()
  
    }
  
    @IBAction func faceBookShareButton(sender: UIButton) {
      if SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook) {
        let fbShare:SLComposeViewController = SLComposeViewController(forServiceType: SLServiceTypeFacebook)
  
        let text = musicDescription.text
  
        fbShare.setInitialText(text)
  
  
        self.presentViewController(fbShare, animated: true, completion: nil)
  
      } else {
        let alert = UIAlertController(title: "Accounts", message: "Please login to a Facebook account to share.", preferredStyle: UIAlertControllerStyle.Alert)
  
        alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil))
        self.presentViewController(alert, animated: true, completion: nil)
      }
  
    }
  </code></pre>
  
  <p>}</p>
  
  <p>But i am not able to see the text of the label in my facebook timeline. Someone guide me here . Why is the text not posting in facebook ?</p>
  
  <p>Edit:Update 
  I downloaded FBSDK files and added them to my project . I imported FBSDKShareKit into my ViewController.h file.</p>
  
  <p>Here is my code </p>
  
  <pre><code> @IBAction func faceBookShareButton(sender: UIButton) {
  
  
  
   if UIApplication.sharedApplication().canOpenURL(NSURL(string: "fb:")!) {
    var content: FBSDKShareLinkContent = FBSDKShareLinkContent()
  
    var Subject: String = String(format: "FBSDKShareKit is an alternative to this issue")
  
    content.contentTitle = "FBSDKShareKit"
    content.contentDescription = Subject
  
    var dialog: FBSDKShareDialog = FBSDKShareDialog()
    dialog.fromViewController = self
    dialog.shareContent = content
    dialog.mode = FBSDKShareDialogModeWeb
    dialog.show()
  }
  </code></pre>
  
  <p>I am getting an error "Use of unresolved identifier FBSDKShareDialogModeWeb"
  .
  Anyone help please !</p>