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];
}
}