From b3bcf5f9342422ab0caecb80cedba448d2fefea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Pantale=C3=A3o=20Gon=C3=A7alves?= <5808343+bgoncal@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:04:10 +0200 Subject: [PATCH] Fix share server button crash on iPad due to wrong sourceView (#3667) ## Summary ## Screenshots ## Link to pull request in Documentation repository Documentation: home-assistant/companion.home-assistant# ## Any other notes --- .../ConnectionSettingsViewController.swift | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Sources/App/Settings/Connection/ConnectionSettingsViewController.swift b/Sources/App/Settings/Connection/ConnectionSettingsViewController.swift index 146a614a9..210124131 100644 --- a/Sources/App/Settings/Connection/ConnectionSettingsViewController.swift +++ b/Sources/App/Settings/Connection/ConnectionSettingsViewController.swift @@ -312,13 +312,14 @@ class ConnectionSettingsViewController: HAFormViewController, RowControllerType let activityVC = UIActivityViewController(activityItems: [invitationURL], applicationActivities: nil) if let popover = activityVC.popoverPresentationController { - popover.sourceView = shareButton.customView - popover.sourceRect = shareButton.customView?.bounds ?? CGRect( - x: view.bounds.width - 1, - y: 0, - width: 1, - height: 1 + popover.sourceView = view + popover.sourceRect = CGRect( + x: view.bounds.midX, + y: view.bounds.midY, + width: 0, + height: 0 ) + popover.permittedArrowDirections = [] } present(activityVC, animated: true, completion: nil) }