Search code examples
swiftuiactivityviewcontroller

Can't see Reminders app option in UIActivityViewController


I have a comma-separated string like this: "Banana,Cake". I want to share this string to the Reminders app through UIActivityViewController, but while opening the controller, I can't see an option for Reminders there.

I have seen it in the YouTube app. If a content is being shared, it shows the Reminders app as an option.


Solution

  • You must pass an array of a string and an URL to activityItems in order to display Reminders as an option.

    if let url = URL(string: "http://example.com") {
        let activityVc = UIActivityViewController(activityItems: ["string", url], applicationActivities: nil)
    }