Post

Replies

Boosts

Views

Activity

LinkPresentation startFetchingMetadata errors
I’m trying to use the Link Presentation app in my SwiftUI app. When I try to fetch metadata, I get quite a few errors in the console. Here’s a stripped down version of the code that causes errors: public struct URLMetadataLoader { public static func metadata(for url: URL) async -> LPLinkMetadata? { let metadataProvider = LPMetadataProvider() do { let metadata = try await metadataProvider.startFetchingMetadata(for: url) return metadata } catch { print("Failed to get metadata for URL: \(error.localizedDescription)") return nil } } } The errors I get on every call to fetch metadata are below. Thanks. Failed to resolve host network app id to config: bundleID: com.apple.WebKit.Networking instance ID: Optional([_EXExtensionInstanceIdentifier: 0501F943-B5B6-4F60-95B0-CDECFC2AE908]) Type: Error | Timestamp: 2024-10-07 12:17:36.877477-05:00 | Process: URLMetaDataMinimal | Library: ExtensionFoundation | Subsystem: com.apple.extensionkit | Category: default | TID: 0x1f1c18 Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))" UserInfo={NSLocalizedFailureReason=((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))}> 0x12602cd80 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=80284, error: (null) Failed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x600000c6fbd0 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}} Failed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x600000c8cc60 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}}
2
1
471
Oct ’24
Pausing UndoManager (with CoreData)
I have undoManager working with a CoreData backed app but I would like to either pause undoManager during certain data changes or be able to pop the last undo off the undoManager “stack". Ideally, I would like to Delete Object A Pause undoManager Delete Object B Unpause undoManager Delete Object C So the undo stack looks like: Undo Delete Object C Undo Delete Object A In this instance, object B was created by an unfinished multi-screen workflow that was canceled by the user - but there are a few other examples in my app as well. So far I have tried disableUndoRegistration() like so: container.viewContext.processPendingChanges() container.viewContext.undoManager?.disableUndoRegistration() This has no effect. The undo action is still recorded. I have tried swapping the undoManager to nil after parking it elsewhere and then reassigning it after deleting object B. This effectively works the same as undoManager.removeAllActions(). And I have tried removing all actions for the target Object B after deleting Object B. Also with no effect. viewContext.undoManager?.removeAllActions(withTarget: objectB) My workaround is to simply reset the entire stack with .removeAllActions() but that’s not ideal. Any ideas on how to make this work? Thanks.
2
0
418
Jul ’24
Creating a navigation link within a chart?
I’d like to create a simple Gantt chart where each horizontal BarMark is a navigation link to a detail view. When I embed a navigation link within a chart, I get the error “Static method 'buildExpression' requires that 'some ChartContent' conform to 'View’” NavigationLink(value: taskGroup) { BarMark( xStart: .value("Start", taskGroup.start), xEnd: .value("End", taskGroup.end), y: .value("Event", taskGroup.taskGroupName), height: barHeight ) } I could use a chart overlay and manage the navigation from there, but it appears I can only grab published chart data at a given tap gesture. I need the object itself to inject into the detail view (in this case TaskGroup) and the data I’m plotting in the chart isn’t unique - so no obvious way to identify which TaskGroup the user tapped.
3
0
556
Jun ’24