I am trying to present a UIActivityViewController within a Sprite Kit scene to share the users high score. I am using a SKSpriteNode as a button.
My code:
MyScene.h
@property (nonatomic, weak) ViewController * spriteViewController;
ViewController.m
// within viewDidLoad method
MyScene * myScene = [[MyScene alloc] init];
myScene.spriteViewController = self;
MyScene.m
// within touchesDidBegin method
if ([_shareButton containsPoint:touchLocation]) {
NSString * textToShare = [NSString stringWithFormat:@"I just... blah", [GameData sharedGameData].highScore];
NSArray * items = @[textToShare];
UIActivityViewController * activityVC = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypeAddToReadingList, ...];
[self.spriteViewController presentViewController:activityVC animated:YES completion:nil];
Please disregard any typos as I quickly typed that out as my code is on another computer.
The above code does nothing. I assume that it is displaying the UIAVC on the VC but not on top of the scene, but I am probably wrong. Am I going about this completely wrong? I can't seem to find help in the Apple Documentation nor google.
Your guidance is greatly appreciated.