0

I'm building an article reading app for iPhone.

In viewDidLoad i have added a navigation barButton for share sheet.
When i click on share button share sheet opens with google mail button and facebook button. now i want to call my own function on click of facebook button in share sheet.

here is code:

- (IBAction)ysshareAction:(id)sender {
  //share sheet defination

  NSURL *Imageurl = [NSURL URLWithString:_DetailModal1[2]];
  NSData *data =  [NSData dataWithContentsOfURL:Imageurl];

  UIImage *image = [[UIImage alloc] initWithData:data];

  NSURL *linkURL = [NSURL URLWithString:_DetailModal1[4]];//article url

  NSMutableAttributedString *stringText = [[NSMutableAttributedString alloc] initWithString:_DetailModal1[0]];//_DetailModal1[0] contain article title////
  [stringText addAttribute:NSLinkAttributeName value:linkURL range:NSMakeRange(0, stringText.length)];
      //If(click on fb button)   //Isuue is here
       //  { do following  }
  NSArray *itemArrany = @[stringText,image,];//title is displayed but not as hyperlink.
      UIActivityViewController *AVC = [[UIActivityViewController alloc]     initWithActivityItems:itemArrany applicationActivities:nil];
     AVC.excludedActivityTypes=@[];
      [self presentViewController:AVC animated:YES completion:nil];

      }
ChintaN -Maddy- Ramani
  • 5,156
  • 1
  • 27
  • 48
Raghav Singh
  • 143
  • 1
  • 1
  • 13

0 Answers0