我正在尝试以编程方式截取屏幕截图并在点击按钮时将其分享到社交媒体网络,但是,我无法弄清楚如何执行此操作。我将不胜感激任何帮助
-(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];
}
}