如何以编程方式截取屏幕截图并将其分享到社交网络?

时间:2015-10-02 20:57:13

标签: ios objective-c share screenshot social-networking

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

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


}

0 个答案:

没有答案
相关问题