Skip to content

Commit

Permalink
refactor(FileActionsFloatingPanelViewController): Upgraded deprecated…
Browse files Browse the repository at this point in the history
… UIApp call to iOS15 UIScene API
  • Loading branch information
adrien-coye committed Jan 31, 2025
1 parent 06fe0bd commit 0e874c6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ final class FileActionsFloatingPanelViewController: UICollectionViewController {
func downloadFile(action: FloatingPanelAction,
indexPath: IndexPath,
completion: @escaping () -> Void) {
guard let observerViewController = UIApplication.shared.windows.first?.rootViewController else { return }
guard let activeScene = UIApplication.shared.connectedScenes
.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene,
let observerViewController = activeScene.windows.first?.rootViewController else {
return
}

downloadAction = action
setLoading(true, action: action, at: indexPath)
downloadObserver?.cancel()
Expand Down

0 comments on commit 0e874c6

Please sign in to comment.