Last active
June 6, 2016 06:49
-
-
Save Adnan1990/3c4277ca1827e60bdf24 to your computer and use it in GitHub Desktop.
Sharing on fb or twitter using social.framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <UIKit/UIKit.h> | |
| @interface ViewController : UIViewController | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Social/Social.h> | |
| #import "ViewController.h" | |
| @interface ViewController () | |
| - (IBAction)postToFacebook:(id)sender; | |
| @end | |
| @implementation ViewController | |
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| // Do any additional setup after loading the view, typically from a nib. | |
| } | |
| - (void)didReceiveMemoryWarning | |
| { | |
| [super didReceiveMemoryWarning]; | |
| // Dispose of any resources that can be recreated. | |
| } | |
| - (IBAction)postToFacebook:(id)sender | |
| { | |
| SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; | |
| [controller setInitialText:@"In the Name of Allah ,The most merciful,The most beneficient"]; | |
| [self presentViewController:controller animated:YES completion:nil]; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment