Quick Links

Collecting user input with async/await?

I'm working on an app that has to allow the user to scan a barcode, then enter some data about the item that was scanned. Once the data has been collected, the app automatically drops back into scanning mode.

I've implemented this using two callbacks. There's a callback that fires when a scan completes, which shows a UIViewController with the data entry fields. The data collection screen fires another callback when the user hits a Done button.

This seems like the perfect scenario for async and await, but I can't find any examples that match what I'm trying to do.

I did stumble across PresentViewControllerAsync, but I can't find any documentation about how it's supposed to work, and I wasn't able to suss it out with a Hello World app.