简体   繁体   中英

Immediately Segue After Scanning an Image with AVCaptureDevice

My view scans a barcode then segues to another view where it loads info from a website about the barcode. My problem is that after scanning the the screen freezes instead of immediately segueing to the new view where it would show a loading indicator until the data loaded. The segue only happens AFTER all the information has loaded or has failed to load etc. How can I get this transition to happen?

You are trying to do this processing on the main thread, I'd bet. Read up on Grand Central Dispatch so you can offload this work onto a background thread, leaving your UI responsive.

(If you post code we can be more specific...)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM