0

m reasking this question i have a uiwebview with a button inside the webview looks like this:

Share Application

now what i need is the app to get the url check the first 4 characters = “sha:” if true, run share command if false, open in webview

now by sharing the app i want kind off this

NSString *textToShare = @"Look at this awesome website for aspiring iOS Developers!"; NSURL *myWebsite = [NSURL URLWithString:@"http://www.codingexplorer.com/"];

NSArray *objectsToShare = @[textToShare, myWebsite];

UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil];

NSArray *excludeActivities = @[UIActivityTypeAirDrop,
                           UIActivityTypePrint,
                           UIActivityTypeAssignToContact,
                           UIActivityTypeSaveToCameraRoll,
                           UIActivityTypeAddToReadingList,
                           UIActivityTypePostToFlickr,
                           UIActivityTypePostToVimeo];

activityVC.excludedActivityTypes = excludeActivities;

[self presentViewController:activityVC animated:YES completion:nil];
}

thank you in advance

ldz
  • 2,217
  • 16
  • 21
davie
  • 157
  • 3
  • 9
  • Please [edit] your question to show [the code you have so far](http://whathaveyoutried.com). You should include at least an outline (but preferably a [mcve]) of the code that you are having problems with, then we can try to help with the specific problem. You should also read [ask]. – Toby Speight May 23 '17 at 13:37

1 Answers1

0

yes you can.

Then add the following in one of your methods (for example, viewDidLoad)

UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setTitle:@"Show View" forState:UIControlStateNormal];
button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0); //position
[button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; // set text color

[webview addSubview:button]; // add it on top
  • sorry to bother im stuck with 2 issues I want this button to lay on a certain place and when I change the position it does not move and last question if I push this button it does not do any thing and I want it to share application in objc the code I used I found here but it seems to not pick up the actions any idea? found coding here https://stackoverflow.com/questions/13287007/social-action-sheet-like-on-ios-6 – davie May 23 '17 at 07:20