title: UIActivityViewController - No share options - Swift 5
body: <p>I have implemented a UIActivityViewController in Swift 5 via a nav bar button and upon click this should share the contents of an array called sharedData. </p>
  
  <p>When clicking the button, the share options popup is empty.</p>
  
  <p>Here is my func code:</p>
  
  <pre><code>    @IBAction func shareNavButton(_ sender: UIBarButtonItem) {
          let shareItems: [Any] = [sharedData]
          let activityVC = UIActivityViewController(activityItems: shareItems, applicationActivities: nil)
          activityVC.popoverPresentationController?.barButtonItem = sender
          self.present(activityVC, animated: true, completion: nil)
      }
  </code></pre>
  
  <p>Here is my entire VC code:</p>
  
  <pre><code>class FavoritesViewController: UIViewController {
  
      @IBOutlet var tableView: UITableView!
  
      @IBAction func shareNavButton(_ sender: UIBarButtonItem) {
          let shareItems: [Any] = [sharedData]
          let activityVC = UIActivityViewController(activityItems: shareItems, applicationActivities: nil)
          activityVC.popoverPresentationController?.barButtonItem = sender
          self.present(activityVC, animated: true, completion: nil)
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          convertArray()
      }
  }
  
  extension FavoritesViewController: UITableViewDelegate, UITableViewDataSource {
  
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
  
          return sharedData.count
      }
  
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
          let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
          cell.textLabel?.numberOfLines = 0
          cell.textLabel?.text = sharedData[indexPath.row]
          return cell
      }
  
      func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -&gt; Bool {
  
          return true
      }
  
      func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath)
          -&gt; UISwipeActionsConfiguration? {
              let deleteAction = UIContextualAction(style: .destructive, title: "Remove") { (_, _, completionHandler) in
                  sharedData.remove(at: indexPath.row)
                  saveArray()
                  tableView.beginUpdates()
                  tableView.deleteRows(at: [indexPath], with: .automatic)
                  tableView.endUpdates()
                  completionHandler(true)
              }
              if #available(iOS 13.0, *) {
                  deleteAction.image = UIImage(systemName: "trash")
              } else {
                  // Fallback to default action
              }
              deleteAction.backgroundColor = .systemRed
              let configuration = UISwipeActionsConfiguration(actions: [deleteAction])
              return configuration
      }
  
      func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -&gt; UISwipeActionsConfiguration? {
          let copyAction = UIContextualAction(style: .normal, title: "Copy") { (_, _, completionHandler) in
  
              let cell = tableView.cellForRow(at: indexPath)
              UIPasteboard.general.string = cell?.textLabel?.text
  
              completionHandler(true)
          }
          if #available(iOS 13.0, *) {
              copyAction.image = UIImage(systemName: "doc.on.clipboard")
          } else {
              // fall back to default action
          }
          copyAction.backgroundColor = .systemBlue
          let configuration = UISwipeActionsConfiguration(actions: [copyAction])
          return configuration
      }
  
  }
  
  </code></pre>