My Share extension's view height seems to be rendered smaller than needed to accommodate the SLComposeSheetConfigurationItem. as you can see in attachment, it seems to be cut off from the bottom ("to: test@email.com") and I have to scroll it to see it all. Any idea why it might be happening. I am not customizing it in any way.

- 4,642
- 7
- 44
- 97
-
1you should post some code to check – Mahesh Dangar Aug 26 '19 at 07:00
-
Also could not get the part of the UI in which you are getting issue! It would be great if you can post a gif. – Karthick Ramesh Aug 27 '19 at 04:30
-
If you look at the bottom part "To: test@email.com", it is not vertically centred. – Kashif Aug 27 '19 at 20:29
-
Which device are you using ? – Sagar Chauhan Aug 28 '19 at 12:06
-
Tested on iPhone XS – Kashif Aug 28 '19 at 12:07
2 Answers
SLComposeServiceViewController
stored SLComposeSheetConfigurationItem
in tablView
, so you need to access tableView
by travelling on subView
and call scrollToRow
for bottom position will fix your issue.
Solution 1:
Add following code in ShareViewController
.
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if let slSheet = self.children.first as? UINavigationController,
let tblView = slSheet.children.first?.view.subviews.first as? UITableView
{
// Scroll tablView to bottom
tblView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .bottom, animated: true)
}
}
Solution 2:
Change the row height will fix your issue, But make sure it is exactly height value which you want, I have used as per my requirements. Default value is 44.
tblView.rowHeight = 35
tblView.separatorStyle = .none

- 5,715
- 2
- 22
- 56
-
-
It moves the whole scrollview up. Even though the configuration item shows properly now, the top of text view with the cursor is now a bit cut off from the top. – Kashif Aug 29 '19 at 13:00
-
-
Is there any way to change the height of the view containing the Image and Text? – Midhun Darvin Apr 23 '20 at 06:24
This seems to be an issue with iOS 13. The sheet's height is controlled by the system. Setting the preferredContentSize
property doesn't have any effect. I'm using the following workaround:
override func viewDidLoad() {
super.viewDidLoad()
if #available(iOS 13.0, *) {
_ = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidShowNotification, object: nil, queue: .main) { (_) in
if let layoutContainerView = self.view.subviews.last {
layoutContainerView.frame.size.height += 10
}
}
}
}
The last subview
of self.view
is an instance of UILayoutContainerView
, which is a private UIKit class. This class determines the size of the share dialog, but doesn't have any constraints attached to it. Therefore I have to set the frame
property directly. I'm using the keyboardDidShowNotification
callback because the frame
is updated by the system when the keyboard appears.
If anyone comes up with a better solution, please let me know.

- 776
- 8
- 16
-
-
it does work. It's just that the frame resize is visible. I wish it would resize the frame before displaying it. – Kashif Oct 08 '19 at 13:44