0

What's the best way to present a UIView on a UIViewController from inside a UIActivity. I tried the code below but that's not working. Aside from that there doesn't seem to be any documentation on this.

- (void)performActivity {
    ...
    do some stuff
    ...

    [self.activityViewController.presentingViewController.view addSubview:toast];

    [self activityDidFinish:YES];
}
user4992124
  • 1,574
  • 1
  • 17
  • 35

1 Answers1

0

I managed to make it work by just retrieving the current UIView.

UIView *vc = [[[[UIApplication sharedApplication] keyWindow] subviews] lastObject];
[vc addSubview:toast];
user4992124
  • 1,574
  • 1
  • 17
  • 35