Post

Replies

Boosts

Views

Activity

Async/let producing error in playground? Xcode 13.0 beta
I'm seeing an error trying to test out async let. It seems like this should work, based on the async/let and structured concurrency session videos. Here's the code: func doIt() async -> String {     let t = TimeInterval.random(in: 0.25 ... 2.0)     Thread.sleep(forTimeInterval: t)     return String("\(Double.random(in: 0...1000))") } async {     async let a = doIt()     async let b = doIt()     async let c = doIt()     async let d = doIt()     let results = await [a, b, c, d]     for result in results {         print("  \(result)")     } } But, I get this error for every "async let" statement: error: AsyncLetSwift55WWDC21.playground:12:15: error: expression is 'async' but is not marked with 'await' async let a = doIt() ^ await Am I missing something key, or is this a bug? I'm running this in the Xcode 13.0 beta, in a Playground. Thanks!!
12
0
4.4k
Aug ’21
Source code for Push To Talk demo app?
I was just watching the Enhance voice communication with Push To Talk WWDC22 session video and was wondering (a few questions) -- (1) (when) will you be making the demo app available that was shown at the beginning of the video? (2) There was some detail given regarding the new APNs push type ("pushtotalk"), but it was unclear to me if that's something I need to handle manually, or if those will be sent automatically when I do channelManager.requestBeginTransmitting? (3) How does the audio data itself get routed around? Is that handled by the system between the requestBeginTransmitting and stopTransmitting calls? Or somehow part of the APNs payload? Or something we must handle? Thank you! thanks!!
6
1
3.8k
Oct ’23
DYLD_PRINT_STATISTICS not working / Xcode 13.0 beta / iOS 15.0 beta 8
Hello! I'm working on a new app, and DYLD_PRINT_STATISTICS=1 is not working - i.e., not producing any output. Build platform: MacBook Pro (15-inch, 2018) macOS Monterey, 12.0 beta 6 (21A5506j) Xcode 13.0 beta 5 (13A5212g) Test device: iPad 8th generation iPadOS 15.0 beta 8 (19A5340a) I'm setting it as usual in Product -> Scheme -> Edit Scheme, then going to "Run" tab on the left and choosing "Arguments" on the top. In that screen I enter "DYLD_PRINT_STATISTICS" for Name and "YES" for Value. Nothing prints. I also tried: Using "1" for Value instead of "YES" Entering "DYLD_PRINT_STATISTICS=YES" as Name and leaving Value blank Entering "DYLD_PRINT_STATISTICS=1" as Name and leaving Value blank Every combination of the above, but as command-line arguments instead of environment variables. Also, I tried "DYLD_PRINT_APIS" as Name and "YES" as Value, and that works normally. What's going on here? Is it something with the all-SwiftUI lifecycle? An issue with the beta macOS/Xcode/iPadOS? Thanks!
4
1
6.8k
Mar ’22