title: Activity View Controller not showing the entire popup
body: <p>I am trying to make a drawing app and I want to add the activity view controller. It works on the iPhone, but it will not show the entire view controller on the iPad. I have tried many different approaches based off what I have read, but the result is the same. Any help is appreciate.</p>
  <p><a href="https://i.stack.imgur.com/g6SD9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g6SD9.jpg" alt="Ipad error" /></a></p>
  <p>Code:
  @IBAction func actionsTapped(_ sender: Any) {</p>
  <pre><code>    // Setting description
      let message = &quot;Actions for your drawing&quot;
      
      // Get the image to save
      let image = getImage()
  
      let activityViewController : UIActivityViewController = UIActivityViewController(activityItems: [message, image], applicationActivities: nil)
      
      // Ipad popup
      activityViewController.popoverPresentationController?.sourceView = (self.view)
      
      // Remove Ipad arrow
      activityViewController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.down
      activityViewController.popoverPresentationController?.sourceRect = CGRect(x: 150, y: 150, width: 0, height: 0)
      
      // Pre-configuring activity items
      activityViewController.activityItemsConfiguration = [
          UIActivity.ActivityType.message,
          UIActivity.ActivityType.print,
          UIActivity.ActivityType.saveToCameraRoll,
          UIActivity.ActivityType.airDrop
      ] as? UIActivityItemsConfigurationReading
      
      // Exclude
      activityViewController.excludedActivityTypes = [
          UIActivity.ActivityType.postToWeibo,
          UIActivity.ActivityType.addToReadingList,
          UIActivity.ActivityType.postToFlickr,
          UIActivity.ActivityType.postToVimeo,
          UIActivity.ActivityType.postToTencentWeibo,
          UIActivity.ActivityType.postToFacebook
      ]
      
      activityViewController.isModalInPresentation = true
      self.present(activityViewController, animated: true, completion: nil)
  
  }
  </code></pre>
  <p>As someone pointed out, which I tried changing the height and width in the sourceRect does not work. See below where I changed</p>
  <pre><code>activityViewController.popoverPresentationController?.sourceRect = CGRect(x: 150, y: 150, width: 0, height: 0)
  </code></pre>
  <p>to</p>
  <pre><code>activityViewController.popoverPresentationController?.sourceRect = CGRect(x: 150, y: 150, width: 500, height: 500)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/p7cIO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p7cIO.jpg" alt="heigh x and width" /></a></p>
  <p>My initial thought was that x and y would change the position of the popup and height and width change the size, but it seems that it's the reverse in sourceRect.</p>