I'm trying create a subclass of UIActivity
to add a custom button to a UIActivityViewController
. I want this custom button to be able to open a link without leaving the application. I've found numerous solutions that allow for opening things in safari, but I can't figure out if it is possible to just open a UIWebview
inside my app (Modal view perhaps?).
I've tried creating a `UIWebview in the delegate method to handle the click, but since this isn't a viewcontroller I can't add it to the view hierarchy.
- (void)prepareWithActivityItems:(NSArray *)activityItems{
UIWebView *webView=[[UIWebView alloc] initWithFrame:CGRectMake(0,0,320,480)];
NSURLRequest *urlRequest;
NSURL *urlforWebView;
urlforWebView=[NSURL URLWithString:@"http://www.google.com"];
urlRequest=[NSURLRequest requestWithURL:urlforWebView];
[webView loadRequest:urlRequest];
}