Post

Replies

Boosts

Views

Activity

Reply to See log in XCode for "Wait for executable to be launched"
You have to use Logger for that. It will output the messages to Console.app, as well as to Xcode console. However, you have to specify them as public, otherwise the message text will be hidden. Like this: import os.log let logger = Logger(subsystem: "com.kelin.vladimir", category: "Debug") // Log level: notice. Explicitly specified `public`. logger.notice("\("TEST", privacy: .public)") In order to protect your private data in prod, consider using #if DEBUG macro.
5d
Reply to Inserting SF Symbols in a string ?
To save your time I copy-pasted Michcio's answer from the SO link posted by @Claude31 above: let imageAttachment = NSTextAttachment() imageAttachment.image = UIImage(systemName: "checkmark.circle") // If you want to enable Color in the SF Symbols. imageAttachment.image = UIImage(systemName: "checkmark.circle")?.withTintColor(.blue) let fullString = NSMutableAttributedString(string: "Press the ") fullString.append(NSAttributedString(attachment: imageAttachment)) fullString.append(NSAttributedString(string: " button")) label.attributedText = fullString
Aug ’24
Reply to Xcode 15 beta 7 Previews building issue
Guys, actually, I found an unexpected workaround! If you can isolate the view, that potentially crashes, try to extract it in a separate View file. Make a custom subview that uses the 3d party lib, that causing the crash. In my case it was ACarousel. Then, in the view that you actually need to preview, use this subview. If the 3d party lib isn't imported there, the preview will work. Fantastic! This cost me 6 hours of work.
Jun ’24
Reply to LinkDylibError when previewing SwiftUI view from a package.
The accepted answer is not an answer, but a comment. I have the similar issue with ACarousel preview. LinkDylibError: Failed to build PaywallCarousel.swift ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) This discussion is similar and have much more activity: https://forums.developer.apple.com/forums/thread/736152?page=2
Jun ’24
Reply to Xcode 15 beta 7 Previews building issue
I have the same issue with the view using ACarousel in Xcode version 15.3 (15E204a). Sorry Apple, I can't install Xcode 16 right now, I need everything to work predictable. The preview stopped to work suddenly and nothing of the above fixes work. Also, for some reason preview started to fail if XCTest fails to build.
Jun ’24
Reply to Could Not Launch Mac (Designed for iPad) App in Xcode
I had the exact same set of errors as @SpaceMan in my macOS app. Here the entire error stack: Could not launch “CloudKitCMS” Domain: IDELaunchErrorDomain Code: 20 Recovery Suggestion: Runningboard has returned error 5. Please check the system logs for the underlying cause of the error. -- Could not launch “CloudKitCMS” Domain: IDELaunchErrorDomain Code: 20 Recovery Suggestion: Runningboard has returned error 5. Please check the system logs for the underlying cause of the error. -- The operation couldn’t be completed. Launch failed. Domain: RBSRequestErrorDomain Code: 5 Failure Reason: Launch failed. -- Launchd job spawn failed Domain: NSPOSIXErrorDomain Code: 153 -- I tried editing apple id but without any success. I noticed that some people refer entitlements, so I inspected by CloudKitCMS.entitlements file and found that several keys there are totally irrelevant to the project: <key>aps-environment</key> <string>development</string> <key>com.apple.developer.applesignin</key> <array> <string></string> </array> <key>com.apple.developer.aps-environment</key> <string>development</string> So I completely removed the above keys and now it runs! I must note that my project doesn't use Push Notifications (aps-related keys) and I don't know how those keys got there, probably Xcode added them automatically. So my recommendation would be to check the entitlements and remove everything that's not enabled for the bundle id.
May ’24
Reply to How to reduce complication extension executable size?
Further investigations. Extended memory growth happens inplaceholder(in:) func of a TimelineProvider. In getSnapshot(in:completion:) and getTimeline(in:completion:) memory doesn't grow. Maybe the key difference here is that placeholder(in:) is a syncrhonous function, while two others use completions. I suppose internal WidgetKit implementation runs a for loop through all the widgets and accumulates placeholder images array. Then writes it to disk and memory decreases.
Feb ’24