Skip to content

Fix alerts crash when controller is not in view hierarchy#1

Open
vladpcog wants to merge 4 commits into
Geotab:mainfrom
TransfloEngineers:Vlad/Alerts_Crash_Fix
Open

Fix alerts crash when controller is not in view hierarchy#1
vladpcog wants to merge 4 commits into
Geotab:mainfrom
TransfloEngineers:Vlad/Alerts_Crash_Fix

Conversation

@vladpcog

@vladpcog vladpcog commented Aug 7, 2023

Copy link
Copy Markdown

Summary

  • Check that the view controller is present in the view hierarchy before trying to present the alert, so as to avoid crashes when the view is not in the hierarchy.
  • Check that there is no other alert already presented by the implementor, so as to avoid the completion handler never getting called and crashing the app.

⚠️ I removed the testTarget part from the Package.swift, because I could not build the package in Xcode 14.1, as there was no testTarget in the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant