-1

I am working on a sharing functionality where I have achieved the basic sharing part and is working perfectly. Below is the code for same

 let message = "Download the app from the link below"
 //Set the link to share.
 if let link = NSURL(string: "http://yoururl.com") {
 let objectsToShare = [message,link] as [Any]
 let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
                activityVC.excludedActivityTypes = [UIActivityType.airDrop, UIActivityType.addToReadingList]
                self.present(activityVC, animated: true, completion: nil)
            }

The above code is working great and gives the output as seen in the screenshotenter image description here

What I want is to have an extra icon/option to share the content for the frequently used app. for e.g. I use Whatsapp frequently so the share window should show WhatsApp icon somewhere besides "More".

any help will be highly appreciated. TIA

iDeveloper
  • 940
  • 1
  • 10
  • 45
  • 1
    I don’t think this can be done. iOS does not provide this function and you cannot query for frequently used apps, which would certainly raise privacy concerns. – idmean Jun 24 '18 at 08:52
  • you can't add as you want. It is handle by UIActivityViewController default, it checks which app is installed in device and provide sharing features. – Hardik Thakkar Jun 25 '18 at 06:30

1 Answers1

1

This can't be done because the share sheet is a library provided by apple and only the user can rearrange icons on their own!

Luke Pistrol
  • 1,199
  • 3
  • 12
  • 26