I am trying to present UIActivityViewController
on an SkView
but xcode gives me this error :
No visible @interface for 'GameOver' declares the selector
'presentViewController:animated:completion:'
- (void)shareScore {
//add view
UIView *Sview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 512, 512)];
UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shareScoreImg.png"]];
image.frame = Sview.frame;
[Sview addSubview:image];
//add label
CGRect fframe = self.view.frame;
UILabel *score = [[UILabel alloc] initWithFrame:fframe];
score.text = @"9999";
score.textAlignment = NSTextAlignmentCenter;
score.textColor = [UIColor darkGrayColor];
score.center = CGPointMake(250, 440);
score.font = [UIFont fontWithName:@"Pixel LCD7" size:50];
[Sview addSubview:score];
//capture view
UIGraphicsBeginImageContextWithOptions(Sview.bounds.size, Sview.opaque, 0.0);
[Sview.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIActivityViewController* activityViewController =
[[UIActivityViewController alloc] initWithActivityItems:@[screenshot]
applicationActivities:nil];
[self presentViewController:activityViewController animated:YES completion:nil];
}
How can I present preset a viewController on SKScene ?
thanks .
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…