Post

Replies

Boosts

Views

Activity

Reply to Console app not showing os_log messages from iOS when not run via Xcode
Okay, so your version is working. Thanks again for the detailed examples (which I should've provided in the first place!) I have a hunch why the old os_log is not outputting anything is related to how the unified logging system is handling privacy. Let's say in your example, if I am to put: logger.log("Hello Cruel \(planet)!") When running without Xcode, it will output Hello Cruel to the Console. I'd have to add Hello Cruel \(planet, privacy: .public) for the full message to appear. I assume, when using os_log with format specifiers (%s) and CvarArg, it treats the whole message as private, and that's why it's not outputting anything when run without Xcode. I don't know if there's a way to specify public for the os_log approach. One downside of using Logger is that it's bound to iOS 14, but we're supporting older versions. Cheers
Apr ’23
Reply to Console app not showing os_log messages from iOS when not run via Xcode
Okay. I must have missed the OOP side of logging. Could you please swap in the following and see if it still works? func test() { let oslog = OSLog(subsystem: "com.example.apple-samplecode.Test727380", category: "app") os_log("%s", log: oslog, type: .info, "Hello Cruel World!") } In the meantime, I'll try it out like in your example. Thanks for it. Do you know whether the subsystem needs to match the app bundle ID? Is
Apr ’23
Reply to iCloud for Mac is stuck on "waiting to upload"
Okay, for me what fixed it is, sign out and back into iCloud on the Mac. Then in the options of iCloud Drive in preferences, besides the checkmarks for Documents and Desktop, and various apps, there was a pleonastic entry called iCloud Drive. Ticking that made everything sync and work again. Having said that, I think Apple should remove that inner tick mark and assume the user wants to use iCloud Drive if they ticked the root level iCloud Drive check mark within the iCloud settings. Otherwise that leads users to confusion!
Nov ’22
Reply to Avplayer issue playing video audio from speakers in ios 14.2.1
Solved it. Strange as it is, but the solution that worked for me involved 2 steps (apart from what I wrote above): create an AVAudioEngine and setup voice processing on its input node. When the AVPlayer loads, override the output port. Code: let audioSession = AVAudioSession.sharedInstance() try audioSession.setCategory(.playAndRecord, mode: .videoChat,                     options: [.defaultToSpeaker,                                      .allowAirPlay,                                      .allowBluetooth]) try audioSession.setActive(true) let engine = AVAudioEngine() try engine.inputNode.setVoiceProcessingEnabled(true) let playerItem = AVPlayerItem(url: ...) let player = AVPlayer(playerItem: playerItem) var observer: NSKeyValueObservation? = nil observer = playerItem.observe(\.status, options:  [.new, .old], changeHandler: { (playerItem, change) in        if playerItem.status == .readyToPlay { try? audioSession.overrideOutputAudioPort(.speaker) } } player.play()
Dec ’21