2

I am attempting to programmatically take a screenshot and share it to a social media network when a button is clicked, however, I cannot quite figure out how to do so. I will appreciate any help

    -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
/* Called when a touch begins */
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInNode:self];
SKNode *node = [self nodeAtPoint:location];

if ([node.name isEqualToString:@"twitter"]){
    [self.button play];

    twitter = [[SLComposeViewController alloc] init];
    twitter = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
    [twitter setInitialText:@""];

    UIViewController *twit = self.view.window.rootViewController;
    [twit presentViewController: twitter animated: YES completion:NULL];
}


}
RT33
  • 103
  • 9
  • 1
    http://stackoverflow.com/questions/2200736/how-to-take-a-screenshot-programmatically that shows you how to take a screenshot programmatically http://stackoverflow.com/questions/13239957/slcomposeviewcontroller-with-screenshot-but-not-image-attachment here's how to add an image – tanner0101 Oct 02 '15 at 21:08

0 Answers0