I'm writing a test app which involves "heavy" keychain access with adding and removing keychain items with different access control attributes and different item types.
This app is very simple - has a text area which serves as a log of what's being written and removed; a button which triggers running the tests. The app has only 1 ViewController class which has the IBAction method for the button. This method holds all of the code that reads/removes the keychain items.
My issue is that the app runs great if it's launched from XCode - when the button's clicked, I get the keychain prompts for TouchID and everything looks good. But, as soon as I launch the app from the Springboard, and click the button, I get the keychain prompt but the app crashes after a few seconds. Examining the logs shows that the cause is "scene-update watchdog transgression: exhausted real time allowance of 10.00 secs".
What am I doing wrong and how different is launching from XCode vs a user launching it?
Evidently, I'm not an experienced developer and would like some help/pointers in the right direction.
Edited to add code: There's just for of valet.set() or seceureValet.set() going on.
@IBAction func keychainItemsTest() {
log.text += "Starting read/write..."
valet.removeAllObjects()
secureValet.removeAllObjects()
log.text += "Adding value test1 to keychain"
valet.set(string:"test1", forKey:"test1")
...
}