Instead of a .sdef file (or older formats) made in advance and stored in an app’s bundle, I wonder if the script dictionary can be set soon after the app opens? I seen related API, with a note that the scripting file reader ultimately calls that API. I grok about 90% of that API, but I’m not sure it’s possible.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Can the SwiftUI document architecture
Take a file as read-only; never to be written out
Take files too large for memory (multi-MB, or even GB)
I wouldn't want the system to read a gigabyte size file into memory by default. If the system can use a memory-mapped Data as the representation, that'll be something I can make do. It would be even better if I could tell the system that I'll handle all the reading, all I need from it is a reference to the file's location on disk.
Topic:
UI Frameworks
SubTopic:
SwiftUI
For example, let’s propose an XPC service that can connect to websites. Suppose that I want to connect to Apple.com, microsoft.com, and ibm.com. Can 3 service objects be made between the service and client? Or does the service have to return an ID for each web connection, with the client needing to specify which connection ID along with a command?
Just trying to understand the documentation.
Obviously, we can send a request to the service to return all the data at once. Can the data arrive in pieces, involving either multiple async callbacks or a Combine Publisher?
I've heard that when a Mac app implements their version of the Standard AppleEvent suite, the developer can copy "CocoaStandard.sdef" and trim out whatever they don't need. What are the constraints on this trimming?
I guess that we could remove commands wholesale, but can we remove sub-parts of a command? Can we change an enumeration? A record type?
I was looking through:
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_handle_AEs/SAppsHandleAEs.html
And wondered how these are handled for SwiftUI
apps. What would I add or override?
NSApplicationDelegate.application(_:open:) gets the files it needs to read from the file URLs given. There are similar older functions that use a String to identify the file. What format are those strings expecting? A path name? An URL?
We can get informed on object changes through conforming to ObservableObject or having the @Observable macro attached to the type’s definition. How do you handle imported code that assumes the other observation technique?
I'm making an operator Publisher, which has to wrap the upstream publisher. But I want the operator to conditionally conform to ConnectablePublisher, but only when the upstream publisher does the same.
I can make my connect() call the upstream's connect(), but is that all I have to do? That Apple's plumbing will automatically hold back the initial call to the Subscription object if the publisher is connectable. Otherwise, I need to make a flag in the subscription for when to connect, which would involve an infinitely copyable struct somehow send a message to a unique class/actor.
That last part makes sense to me, but it also seems like too much work for something plug-and-play. Having Apple's implementation taking care of that issue also makes sense, and would be a better solution.
This is from an Xcode generated file.
var values: [String] = []
let exp = Expectation()
let c = pub.filter { $0 != nil }.map { $0! }.sink(
The second line gives an error: "'Expectation' cannot be constructed because it has no accessible initializers". My best guess that Expectation objects come from some other Apple Swift Testing function, but I don't know where.
I saw this file among my project's check-in:
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
Does this need to be added to source control? Or the .gitignore file (or equivalent)? Or are there some files within the ".swiftpm" that should be checked in, and others ignored?
Topic:
Developer Tools & Services
SubTopic:
Xcode
I tried making a concurrency-safe data queue. It was going well, until memory check tests crashed.
It's part of an unadvertised git project. Its location is:
https://github.com/CTMacUser/SynchronizedQueue/commit/84a476e8f719506cbd4cc6ef513313e4e489cae3
It's the blocked-off method "`memorySafetyReferenceTypes'" in "SynchronizedQueueTests.swift."
Note that the file and its tests were originally AI slop.