Hey folks!
I'm working on a macOS app which has a Finder Quick Action extension. It's all working fine, but I'm hitting a weird struggle with getting the icon rendering how I would like, and the docs haven't been able to help me.
I want to re-use a custom SF Symbol from my app, so I've copied that from the main app's xcassets bundle to the one in the extension, and configured it for Template rendering.
The icon renders in the right click menu in Finder, the Finder preview pane and the Extensions section of System Settings, but all of them render with the wrong colour in dark mode. In light mode they look fine, but in dark mode I would expect a templated icon to be rendered in white, not black.
I've attached a variety of screenshots of the icons in the UI and how things are set up in Xcode (both for the symbol in the xcassets bundle, and the Info.plist)
I tried reading the docs, searching Google, searching GitHub and even asking the dreaded AI, but it seems like there's not really very much information available about doing icons for Finder extensions, especially ones using a custom SF Symbol, so I would love to know if anyone here has been able to solve this in the past!
Finder preview pane in light mode:
Finder preview pane in dark mode:
Finder quick action context menu:
System Settings extension preferences:
The custom symbol in my .xcassets bundle:
The finder extension's Info.plist:
How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here
Delve into the world of built-in app and system services available to developers. Discuss leveraging these services to enhance your app's functionality and user experience.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello Shortcuts community!
I want to obtain a list of my notes, and well, update them, delete them if needed, and so on. These are simple actions that I can already do.
For this, I saw that shortcuts was pretty simple, and I could get what I wanted and pipe it through the terminal. However, even though I'm a programmer, there's a lot that I'm missing since I cannot pipe anything to the terminal.
I made a simple shortcut to give me some text, and I could obtain it via -shortcuts run "Example" | cat-, which well, gave me the output but with a %.
aaa**%**
Now, I guess this works, the important thing is for me to obtain something from shortcuts so that I can configure simple things like obtaining a note, a mail, run some javascript in the browser and so on while obtaining some output via the terminal.
So, I configured something like this:
While I do get a dictionary (only in the shortcuts app, not in the terminal) like:
{ "Title": "Some title" }
And actually a list of them, I don't have them in an array that I would have for my command. And for some reason I've only been able to obtain either the name or the body.
Now, I put them into a text with get text from Repeated results, but I don't think I have a valid Dictionary (JSON) array that I can use, since the terminal doesn't obtain nothing.
So far I've tried:
echo $(shortcuts run "Find Notes")
echo $(shortcuts run "Find Notes" --output-type public.utf8-plain-text -o -)
shortcuts run "Find Notes" | xargs
I wonder what am I missing. I'm not creating the array of dictionaries like I'd like, nor outputting it.
On the other hand, I have some AppleScripts that work, however, given that I cannot find munch information about the support status of AppleScript, I though to update to Shortcuts which is obtaining updates, and then I'm trying to do this simple example on shortcuts.
Thanks for taking a look!
Hello,
I recently installed the macOS 26 beta version on my MacBook Air M3, and I've encountered an issue where edited Word files are failing to save. I’ve tried restarting my laptop and checking for updates, but the problem persists.
Has anyone else experienced this issue? Is there a specific setting I might have missed or any troubleshooting steps you recommend?
Thank you for your assistance!
Topic:
App & System Services
SubTopic:
Hardware
I'm building a weather map that shows the rain on the map. I'm able to retrieve PNG images that are used as tiles to put onto the map. I then reload all the tiles on the map with each timeframe (tile set for every 10 minutes).
I'm able to get the map loaded up and I'm able to place the tiles and reload the data for each time slot. I preload all the PNG data needed for the tiles and store that NSData for them in memory so that they are quick for loading and showing on the map.
I have timer's set to reload the overlay with the next set of tiles for each time slot. Giving the view of a moving precipitation map over time (just like you'd see on any weather map.)
I have 12 time slots (timestamps) showing every 10 minutes for the past 2 hours. I have it showing each in sequence and then repeating.
Over time I get a crash with this error as a Thread 1: signal SIGABRT.
Failed to acquire drawable, rendering to temporary texture
validateRenderPassDescriptor:782: failed assertion `RenderPass Descriptor Validation
MTLRenderPassAttachmentDescriptor MTLStoreActionMultisampleResolve store action at attachment 0 requires resolve texture
'
validateRenderPassDescriptor:782: failed assertion `RenderPass Descriptor Validation
MTLRenderPassAttachmentDescriptor MTLStoreActionMultisampleResolve store action at attachment 0 requires resolve texture
'
Through some searching I've discovered that this seems to be console output from Metal. I assume Metal is used for MapKit to render the overlay tiles?
I'm using the same custom overlay where I set the timestamp on it and then tell it to reload. I also reuse the same MKOverlayRenderer as shown here...
- (MKOverlayRenderer*)mapView:(MKMapView*)mapView rendererForOverlay:(id<MKOverlay>)overlay
{
if ([overlay isKindOfClass:[MKTileOverlay class]]) {
if (!self.rainRenderer) {
self.rainRenderer = [[MKTileOverlayRenderer alloc] initWithTileOverlay:overlay];
self.rainRenderer.alpha = 0.5;
}
return self.rainRenderer;
}
return nil;
}
And here's the function that reloads the overlay...
- (void) updateRainFrame {
self.currentFrameIndex = (self.currentFrameIndex + 1) % self.timestamps.count;
if ((self.currentFrameIndex >= 0) && (self.timestamps.count > self.currentFrameIndex)) {
NSLog (@"self.currentFrameIndex = %lu", self.currentFrameIndex);
NSString *timestamp = self.timestamps[self.currentFrameIndex];
[self.overlay setTimestamp:timestamp];
[self.rainRenderer reloadData];
}
}
The time it takes to crash seems arbitrary. Sometimes it's very quick. Less than a minute. But usually it's several minutes. 10 or 20 minutes or more. Feels like some sort of race condition that's occurring. Perhaps ARC is not able to release the images for the tiles quick enough for each overlay reload? That's a wild guess but I think it's something more deeper in Metal as I feel I would see other errors related to memory availability.
Some of my searches point to something about MSAA needing to be turned off in Metal to resolve this. However I have no idea how I would do that through MapKit.
Any suggestions? Let me know if there is somehow a way to capture more from the crash to give more insight.
Cannot retrieve products for iap or subscription on simulator iPhone 16 and real device iPhone XR also.
lutter: IAPError(code: storekit2_products_error, source: app_store, message: The operation couldn’t be completed. (NSURLErrorDomain error -1009.), details: The operation couldn’t be completed. (NSURLErrorDomain error -1009.))
flutter: Error fetching IAP products: IAPError(code: storekit2_products_error, source: app_store, message: The operation couldn’t be completed. (NSURLErrorDomain error -1009.), details: The operation couldn’t be completed. (NSURLErrorDomain error -1009.))
I've made working Spotlight Import Extension with in macOS 15.5 (24F74). mdimport confirm it's installed, and working. The problem is related to accessing data inside document bundles (package directory)
class ImportExtension: CSImportExtension {
override func update(_ attributes: CSSearchableItemAttributeSet, forFileAt url: URL) throws {
// ERROR: The file "QuickSort.notepad" couldn't be opened because you don't have permission to view it.
let fileWrapper = try FileWrapper(url: url)
}
}
forFileAt url points to a bundle. In order to read the metadata the extension needs to load the bundle from url and access its content, however in the sandbox environment,t the url allows only access to the bundle directory itself in particular NSFileWrapper(url: url) fails with error "The file "name.extension" couldn't be opened because you don't have permission to view it.", and effectively prevent from providing useful metadata.
Is there a way to access the Document Bundle content in order to read the metadata for Spotlight?
Hello,
I want to create a Launch Agent that triggers an executable upon changes in the /Applications folder.
The launch agent is normally a loaded but not running, and by adding /Applications to the WatchPath parameters in the plist, launchd is supposed to trigger the process, that will run and exit once done.
Sadly this seems not to be working uniformly. The script only works on one machine, in the the others the execcutable is never run. There seem not to be any meaningful differences in the launchd or system logs.
The same identical plist works perfectly when changing something in the user's ~/Applications folder. The script does its job and logs are visible.
Is there an undocumented limitation specifically for the /Applications folder that prevents luanchd to observe it in the WatchPaths? Maybe SIP not allowing access? But why does it work on my machine?
Here is an example of the ~/Library/LaunchAgents/com.company.AppName.LaunchAgent.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AssociatedBundleIdentifiers</key>
<string>com.company.AppName</string>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>com.company.AppName.LaunchAgent</string>
<key>ProgramArguments</key>
<array>
<string>/Users/username/Library/Application Support/com.company.AppName/Launch Agent.app/Contents/MacOS/LaunchAgent</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>WatchPaths</key>
<array>
<string>/Users/username/Applications</string>
<string>/Applications</string>
<string>/Network/Applications</string>
</array>
</dict>
</plist>
With the executable being a standard app bundle in /Users/username/Library/Application Support/com.company.AppName/Launch Agent.app
Thank you
Im working on an app which have a lot of diffrent models which are having relationships one to many and so on and on macos Sequoia and Sonoma everything is working but on Tahoe i have this error
SwiftData/SchemaProperty.swift:286: Fatal error: Illegal attempt to create a property that's a sequence of a non-codable type (_buffer - _ArrayBuffer). Did you mean to use a transformable attribute?
I also use computed properties to perform login on model value change like property name is var name: String{
get:{ self._name} set:{ self._name = $0 }
}
var _name: String = ""
I no where use ArrayBuffer i just use [Double] it its needed
I have 3 phones
iPhone 14 iOS 18.3
iPhone Xr iOS 18.5
iPhone Xr iOS 18.4.1
My app has a network extension, and I've noticed each phone having their connectivity interupted by calls on the push provider, calling stop with the noNetworkAvailable reason. The point of confusion is that each phone seems to get it's interuption at different times. For example one will get an interuption at 1:00, while the others is fine, while at 3:00 another will get an interuption, while the others are fine.
This is confusing since a "no network available" seems to imply a problem with the router, or access point, but if that were the case, one would believe it should affect all the phones on the wifi. I don't see less interuptions on the iPhone14 vs the iPhone Xr. Do you believe the iOS version is affecting the performance?
Could you please give me some insight, as to what could be going on inside these phones?
P.S. I also see an error pop up when using NWConnection, this is inside the App. The state update handler will sometimes return the state, waiting(POSIX(.ENETDOWN)) Is there any relation to what's going on in the extension?
I'm building a weather map that shows the rain on the map. I'm able to retrieve PNG images that are used as tiles to put onto the map. I then reload all the tiles on the map with each timeframe (tile set for every 10 minutes).
I'm able to get the map loaded up and I'm able to place the tiles and reload the data for each time slot. But I'm getting a ton of spam on the console every time the tiles are reloaded.
Failed to locate resource named "sky20Grey0@2x.png"
Failed to locate resource named "sky20Grey0@2x.png"
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Compiler failed to build request
Yet the images are showing on the map just fine. But I feel like it's a bit sluggish due to all the spam coming out as I'm reloading this every 0.5 seconds with a timer.
I've tried to load the data from a remote server on demand by overriding the - (void)loadTileAtPath:(MKTileOverlayPath)path result:(void (^)(NSData *tileData, NSError *error))result function. But due to the timer this can lead to the data not getting loaded fully before it switches to the next time slot of data. I therefore pre-load everything. I can then store the NSData in memory and use loadTileAtPath or the NSURL to a stored file and use - (NSURL *)URLForTilePath:(MKTileOverlayPath)path. Both cases work. But both cases have this spam.
I've further refined things such that the MKTileOverlayRenderer is reused but that didn't help. Here's the function for that..
- (MKOverlayRenderer*)mapView:(MKMapView*)mapView rendererForOverlay:(id<MKOverlay>)overlay
{
if ([overlay isKindOfClass:[MKTileOverlay class]]) {
if (!self.rainRenderer) {
self.rainRenderer = [[MKTileOverlayRenderer alloc] initWithTileOverlay:overlay];
self.rainRenderer.alpha = 0.5;
}
return self.rainRenderer;
}
return nil;
}
I'm using one MKOverlay and then just reloading the tiles as needed. Otherwise there is quite a pronounced flicker. Here's that function which is triggered by the NSTimer to happen every 0.5 seconds.
- (void) updateRainFrame {
self.currentFrameIndex = (self.currentFrameIndex + 1) % self.timestamps.count;
if ((self.currentFrameIndex >= 0) && (self.timestamps.count > self.currentFrameIndex)) {
NSLog (@"self.currentFrameIndex = %lu", self.currentFrameIndex);
NSString *timestamp = self.timestamps[self.currentFrameIndex];
[self.overlay setTimestamp:timestamp];
[self.rainRenderer reloadData];
}
}
In that function I'm updating the "timestamp" in the overlay which is the time slot that contains all the tiles for that time. This way my overridden MKTileOverlay can then pass the correct path for the tiles. For example for loading from a file:
- (NSURL *)URLForTilePath:(MKTileOverlayPath)path {
return [self getWeatherTileFileURLForPath:path];
}
Or NSData stored in memory
- (void)loadTileAtPath:(MKTileOverlayPath)path result:(void (^)(NSData *tileData, NSError *error))result
{
return [self getWeatherTileDataForPath:path];
}
But no matter which way I use I keep getting this spam and unfortunately there is no error or anything to point to why it is spamming out.
Also the tiles themselves are PNG files either 256x256 or 512x512 in pixel size.
I saw that this could be something to do with Metal but I'm assuming that's something that MapKit uses.
Very much welcome any thoughts to what could be causing this?
What is the best way to switch between Core Data Persistent Stores?
My use case is that I have a multi-user app that stores thousands of data items unique to each user. To me, having Persistent Stores for each user seems like the best design to keep their data separate and private. (If anyone believes that storing the data for all users in one Persistent Store is a better design, I'd appreciate hearing from them.)
Customers might switch users 5 to 10 times a day. Switching users must be fast, say a second or two at most.
My app already has UI that allows the user to show/hide a menubar icon. If the user disallows my app's icon via System Settings > Menu Bar > Allow in the menu bar, I'd like to customize my own UI to reflect that. Does macOS provide a way for me to determine the "Allow in the menu bar" state for my application?
I'm very unpleased to have found out the hard way, that
vDSP.FFT&lt;T&gt; where T : vDSP_FourierTransformable
and its associated vDSP_FourierTransformFunctions,
only does real-complex conversion!!!
This is horribly misleading - the only hint that it calls vDSP_fft_zrop() (split-complex real-complex out-of-place) under the hood, not vDSP_fft_zop()[1], is "A 1D single- and double-precision fast Fourier transform." - instead of "a single- and double-precision complex fast Fourier transform". Holy ******* ****.
Just look at how people miss-call this routine. Poor him, realizing he had to log2n+1 lest only the first half of the array was transformed, not understanding why [2].
And poor me, having taken days investigating why a simple Swift overlay vDSP.FFT.transform may execute at 1.4x the speed of vDSP_fft_zopt(out-of-place with temporary buffer)! [3]
[1]: or better, vDSP_fft_zopt with the temp buffer alloc/dealloc taken care of, for us
[2]: for real-complex conversion, say real signal of length 16. log2n is 4 no problem, but then the real and imaginary vectors are both length 8. Also, vDSP_fft only works on integer powers of 2, so he had to choose next integer power of 2 (i.e. 1&lt;&lt;(log2n-1)) instead of plain length for his internal arrays.
[3]: you guessed it. fft_zrop(log2n-1, ...) vs. fft_zop(log2n, ...). Half the problem size lol.
Now we have vDSP.DiscreteFourierTransform, which wraps vDSP_DFT routines and "calls FFT routines when the size allows it", and works too for interleaved complexes. Just go all DFT, right?
if let setup_f = try? vDSP.DiscreteFourierTransform(previous: nil, count: 8, direction: .forward, transformType: .complexComplex, ofType: DSPComplex.self) {
// Done forward transformation
// and scaled the results with 1/N
// How about going reverse?
if let setup_r = try? vDSP.DiscreteFourierTransform(previous: setup_f, count: 8, direction: .inverse, transformType: .complexComplex, ofType: DSPComplex.self) {
// Error: cannot convert vDSP.DiscreteFourierTransform&lt;DSPComplex&gt; to vDSP.DiscreteFourierTransform&lt;Float&gt;
// lolz
}
}
This API appeared in macOS 12. 3 years later nobody have ever noticed. I'm at a loss for words.
I'm getting "unsatisfied (Local network prohibited)" when trying accessing my local http server running on mac (http://192.168.0.12:8000/test.txt) from an app running on iPhone with iOS 18.4. That's using URLSession, nothing fancy.
This is the contents of the plist file of the app:
NSAppTransportSecurity
NSExceptionAllowsInsecureHTTPLoads true
NSAllowsArbitraryLoads true
NSAllowsLocalNetworking true
NSExceptionDomains
192.168.0.12
NSIncludesSubdomains true
NSAllowsLocalNetworking true
NSExceptionAllowsInsecureHTTPLoads true
NSLocalNetworkUsageDescription Hello
The app correctly "prompts" the alert on the first app run, asking if I want to access local network, to which I say yes. Afterwards I could see that Local Network is enabled in iOS settings for the app, yet getting those "Local network prohibited" errors.
From testing other global IP + 'http only" sites it feels like NSAllowsArbitraryLoads no longer works as it used to work before. But specifying other test "global" HTTP-only IP addresses in NSExceptionDomains work alright, it's just the local address doesn't.
I could access that IP from iOS safari with no problem. The local web site is HTTP only.
Googling reveals tons of relevant hits including FAQ articles from Quinn, but whatever I tried so far based on those hits doesn't seem to work.
Topic:
App & System Services
SubTopic:
Networking
Because of historical reasons we have the same app with different bundle identifiers in different App Stores, e. g. one in Germany and one in Poland and one in France.
Every app offers a monthly and a yearly in app subscription.
We want to consolidate our apps and user base and want to have only one app in the end. The question is now: Can Apple make the monthly/daily subscriptions from e. g. the app in the store in Poland available or migrate them to the german app in the german App Store when we make the "german" app available also in Poland?
The final goal would be that a user who bought a subscription in the polish store would have the subscription also available on his Apple ID in the german store. Is this possible? Can Apple make this possible?
Topic:
App & System Services
SubTopic:
StoreKit
I am experiencing an issue with my watchOS app. My application updates a shared file, accessible by both the main app and the WidgetKit extension, during a WatchConnectivity background task. Following this update, I call reloadAllTimelines().
This functionality worked as expected on watchOS 10, even without Developer Mode enabled. However, after updating my device to watchOS 11.5, this API appears to be broken.
My reasons for believing this API is broken are threefold:
The functionality worked reliably on watchOS 10.
On watchOS 11.5, enabling "WidgetKit Developer Mode" (found under Settings > Developer) resolves the issue, and my complications update correctly.
When I enter watch face edit mode, the snapshot/preview displayed (which utilizes the same underlying logic as the timeline API) shows the correct data. This indicates that the data has been successfully received from the phone, and the widget is indeed reading the updated shared file. Despite this, the actual widget view during its resting phase never updates.
It's worth noting that TimelineReloadPolicy functions as expected, but I cannot rely on this for my use case. My widget requires immediate updates upon receiving new data.
Apple, please investigate this behavior.
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags:
Watch Connectivity
watchOS
Watch Complications
WidgetKit
When I try to use an entity created in a CoreData, it gives me: 'PlayerData' is ambiguous for type lookup in this context
everytime i get my devicetoken from mdm certification,send to apns (api.push.apple.com 443),always return 400,please help me confirm if the devicetoken is expired or somethine wrong else
here is the request and response
device_token:79c3aec2b2c2b672c3b756c3910977c3a936c3aae280985ac380e280a6091cc2bfc3a132192b14c392c2be7a2ee280a229c3aa
push_magic:AAFDAB81-0E63-4B72-A60A-1F8085325870
status_code: 400
headers: {'apns-id': '14BDD477-7D76-A2FB-582C-140BBD95A420'} resp: {'reason': 'BadDeviceToken'}
Apps distributed via TestFlight have a 90-day expiration period, and we have been sending push notifications to mobile devices daily. Will push notifications still be delivered to mobile devices after the app has expired?
Our backend management system uses Google for Location, and Apple Maps is just one of the solutions in our map component.
When should I convert coordinates to GCJ02?
Maybe you would say that when you are in mainland China?
BUT NOT AT ALL!
What if the user does not enable location permission?
What if the user has not inserted a SIM card? Or not Chinese SIM card but location in China?
OR the user location in China, But use VPN with en overseas IP?
All solutions are not perfect, unless you open the API to developers and tell us whether Apple Maps currently uses the wgs84 coordinate system or gcj02, which is the most reliable.
Topic:
App & System Services
SubTopic:
Maps & Location
Tags:
MapKit
Maps and Location
Apple Maps Server API