refactor: Reduce duplication code with UIApplication.keyWindow and .topController and improve alert function

This commit is contained in:
naturecodevoid
2023-06-01 07:35:07 -07:00
parent f69ad9830a
commit 175b5bec95
9 changed files with 57 additions and 57 deletions

View File

@@ -85,8 +85,7 @@ struct AppPillButton: View {
return
}
let _ = AppManager.shared.install(storeApp, presentingViewController: UIApplication.shared.keyWindow?.rootViewController) { result in
let _ = AppManager.shared.install(storeApp, presentingViewController: UIApplication.topController) { result in
switch result {
case let .success(installedApp):
print("Installed app: \(installedApp.bundleIdentifier)")