Posts

Post not yet marked as solved
0 Replies
646 Views
My goal is to generate a temp file with custom type, and share them to Files. Code: struct Issue: View { @State var myFile : URL? = nil var body: some View { Button("Generate ShareLink") { let url = FileManager.default.temporaryDirectory .appendingPathComponent("my_file") let data = Data([0, 1, 2, 3, 4, 5]) try? data.write(to: url) myFile = url } if let f = myFile { ShareLink(item: f) // This file can be successfully saved to Files } } } This code works but it pops a lot of warnings in console: Failed to request default share mode for fileURL:file:///.../tmp/my_file error:Error Domain=NSOSStatusErrorDomain Code=-10814 "(null)" UserInfo={_LSLine=1608, _LSFunction=runEvaluator} Only support loading options for CKShare and SWY types. error fetching item for URL:file:///.../tmp/my_file : error fetching file provider domain for URL:file:///.../tmp/my_file : Collaboration: error loading metadata for documentURL:file:///.../tmp/my_file error:Error Domain=NSFileProviderInternalErrorDomain Code=0 "No valid file provider found from URL file:///.../tmp/my_file." UserInfo={NSLocalizedDescription=No valid file provider found from URL file:///.../tmp/my_file.} Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "(originator doesn't have entitlement com.apple.runningboard.primitiveattribute AND originator doesn't have entitlement com.apple.runningboard.assertions.frontboard AND target is not running or doesn't have entitlement com.apple.runningboard.trustedtarget AND Target not hosted by originator)" UserInfo={NSLocalizedFailureReason=(originator doesn't have entitlement com.apple.runningboard.primitiveattribute AND originator doesn't have entitlement com.apple.runningboard.assertions.frontboard AND target is not running or doesn't have entitlement com.apple.runningboard.trustedtarget AND Target not hosted by originator)}> connection invalidated Despite of these errors, my 6 bytes file can be saved to Files. But how can I solve these warnings? (I ran this code in a iOS 17.0.1 simulator with Xcode 15.0.1)
Posted
by qdwang.
Last updated
.
Post not yet marked as solved
1 Replies
505 Views
guard let rawfilter = CoreImage.CIRAWFilter(imageData: data, identifierHint: nil) else { return } guard let ciImage = rawfilter.outputImage else { return } let width = Int(ciImage.extent.width) let height = Int(ciImage.extent.height) let rect = CGRect(x: 0, y: 0, width: width, height: height) let context = CIContext() guard let cgImage = context.createCGImage(ciImage, from: rect, format: .RGBA16, colorSpace: CGColorSpaceCreateDeviceRGB()) else { return } print("cgImage prepared") guard let dataProvider = cgImage.dataProvider else { return } let rgbaData = CFDataCreateMutableCopy(kCFAllocatorDefault, 0, dataProvider.data) In iOS 16 this process is much faster than the same process in iOS 17 Is there a method to boost up the decoding speed?
Posted
by qdwang.
Last updated
.
Post not yet marked as solved
0 Replies
279 Views
In Shortcuts, the Show Result action has two features that I cannot reproduce in my swift code. Show Result can connect to the previous action's result automatically when it's added. In my code, I added inputConnectionBehavior: .connectToPreviousIntentResult to my parameter, but it won't work. @Parameter(title: "input", supportedTypeIdentifiers: ["public.plain-text"], inputConnectionBehavior: .connectToPreviousIntentResult) var input: IntentFile The click of Result slot in Show Result allows users to select variable. In my code, the click of MyParameter will open the FileDialog rather than selecting variables. So in whatever way I tried, I cannot make my action work exactly like the Show Result does.
Posted
by qdwang.
Last updated
.