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!
Topic: App & System Services SubTopic: Core OS Tags:
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()
Topic: Media Technologies SubTopic: Audio Tags:
Dec ’21
Reply to Incorrect behaviour when trying to change focus to a focused view inside UIPageViewController
Hello, sorry for the late response. Here is the link to the sample project. Thanks
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to "Invalid Bundle. The bundle <bundle name> does not support the minimum OS Version specified in the Info.plist"
Confirming Xcode 15.4 solved it
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to SKStoreProductViewController quick dismissal issue
I have the same issue. I need to detect when the user dismisses the Store sheet.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to Console app not showing os_log messages from iOS when not run via Xcode
%{public}s works indeed. Thank you for the guidance. I'll see how to tailor it so as to log just non-sensitive data.
Replies
Boosts
Views
Activity
Apr ’23
Reply to Is UIViewRepresentable even capable of handling autolayout within a view?
But that defeats the whole point of autolayout. I've tested and indeed for a UIStackView with complex layout happening inside intrinsicContentSize is always returned as (-1;-1). I guess this is a issue with UIKit itself.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
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
Replies
Boosts
Views
Activity
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
Replies
Boosts
Views
Activity
Apr ’23
Reply to Console app not showing os_log messages from iOS when not run via Xcode
I had already done the above steps. Still the same behaviour, unfortunately.
Replies
Boosts
Views
Activity
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!
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Localization Tests in UI Testing
Hey. You can go into the Scheme Editor of the test scheme under Options, and change App Region/Language to one you prefer, and that will be independent of your current device language. Hope this helps.
Replies
Boosts
Views
Activity
Jun ’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()
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
Dec ’21