I have an app that displays photos from a directory that the user chooses (including children directories).
On launch it checks UserDefaults for stored values, if none from previous run, then asks user to open a directory of photos. Then initializes itself and saves the UserDefaults and also a persistent url so that on subsequent run can re-open directory without user intervention.
When first run and asks for directory, runs fine in setting up app state and saving UserDefaults and persistent url, but when gets to contentView the ImageView fails to show anything, but app continues running for about 15 or 20 sec. changing photo via timer, but no image displayed and then the crash @main hread 1: EXC_BREAKPOINT (code=1, subcode=0x1b8072158) and occurs seemingly async from the running code. Crash report attached.
Then if re-launch app, it gets the saved UserDefaults, does set up and the runs fine, displaying images! Can even change directories (in the full app, with window commands which are not in this short version of the app.