Share hyperlink on twitter using socialize framework in iOS

304 Views Asked by At

I am using Socialize framework for sharing on facebook and twitter. I am totally unaware as how to share hyperlinks on twitter using this framework. I checked out its documentation for twitter sharing thoroughly but no luck. Please shed some light on sharing hyperlink on twitter incase you have any clue.

Thanks

1

There are 1 best solutions below

3
On

Yes you can do following to share.

#import "Social/SLComposeViewController.h"
#import "Social/SLRequest.h"
SLComposeViewController *socialVc=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
                    NSData *data = UIImageJPEGRepresentation(self.defaultImageView.image, 1.0);
                    [socialVc addImage:[UIImage imageWithData:data]];
                    [socialVc setInitialText:[NSString stringWithFormat:@"%@",@"hello"]];
                    [socialVc addURL:[NSURL URLWithString:@"www.xyz.com"]];
                    [self.navigationController presentViewController:socialVc animated:YES completion:nil];

Hope this helps you.