Post

Replies

Boosts

Views

Activity

Reply to Access .icon files in Swift or Objective-C
I'm not sure if it will work with icon assets specifically, but "Supporting Dark Mode in your interface" and "Providing images for different appearances" cover all of these issues. Note that while both of those articles are in the UIKit section, they also cover AppKit. Thanks, but unfortunately this does not work with the new icon styles. Best regards, Marc
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’25
Reply to Access .icon files in Swift or Objective-C
Enabling Include all app icon assets did the trick and I was able to access the icon by its name. Unfortunately, the icon is always rendered in its default appearance and does not adopt the current appearance, such as dark or tinted. Any chance to make this work? Is there a supported way to get the current appearance request the image in a specific appearance receive a notification if the appearance changes? The last point would also be necessary if I were using a regular asset set with PNG representations of the .icon file. Thanks, Marc
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’25
Reply to Access .icon files in Swift or Objective-C
Hi @DTS Engineer! Yes, the asset catalog is inside the plugin bundle and I can access other assets (png) without problems. To make things easier I created a simple app and added some .icon files to it. First I tried to access them using imageNamed: which doesn't work. Then I copied the icon files to the app's Resources folder, got the actual image path using [[NSBundle mainBundle] pathForResource:@"MyIcon" ofType:@"icon"] (which worked) and then to get an image using [[NSImage alloc] initWithContentsOfFile:iconPath] which returned null. So the issue is not about the Dock Tile plug in but a more general issue.
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’25
Reply to WKWebView requires authentication
It turned out that the website uses Microsoft Enterprise SSO for authentication and my app's bundle identifier must be added to the AppAllowList in our Entra ID configuration. Microsoft describes this in the Enable SSO for specific apps section of their KB article Microsoft Enterprise SSO plug-in for Apple devices. After adding the app to that list, everything worked as expected.
Topic: Safari & Web SubTopic: General Tags:
Jul ’25
Reply to Local Authentication & localized reason string
At least for macOS I can say that it still needs that substring. If you look at the APP_ASKING_AUTH keys in /System/Library/Frameworks/LocalAuthentication.framework/Support/coreautha.bundle/Contents/Resources/UIAgent.loctable you'll see exactly this and all my tests with the Local Authentication framework have also confirmed this. Best regards, Marc
Topic: Privacy & Security SubTopic: General Tags:
Feb ’25
Reply to Local Authentication & localized reason string
Local Authorization's evaluatePolicy:localizedReason:reply: requires a partly localized reason, which is not ideal from a localization perspective. This is what the docs say: Application reason for authentication. This string must be provided in correct localization and should be short and clear. It will be eventually displayed in the authentication dialog as a part of the following string: "" is trying to . For example, if the app name is "TestApp" and localizedReason is passed "access the hidden records", then the authentication prompt will read: "TestApp" is trying to access the hidden records. What I found out now is, that the complete strings look as follows: Where the first placeholder contains the app name and the second placeholder contains the localized string the user provided. So I think I should be able to build the string I need. Best regards, Marc
Topic: Privacy & Security SubTopic: General Tags:
Feb ’25
Reply to LAContext and smart cards
During my testing it turned out that even if using Authorization Services, the Mac asks me for Touch ID. I always had in mind that this would only work using Local Authentication. So it seems that I don't have to use either one or the other but can build everything completely using Authorization Services. It asks me for Touch ID or PIN if a PIV token is connected, otherwise it asks me for Touch ID or Password.
Topic: Privacy & Security SubTopic: General Tags:
Jan ’25
Reply to Access .icon files in Swift or Objective-C
I'm not sure if it will work with icon assets specifically, but "Supporting Dark Mode in your interface" and "Providing images for different appearances" cover all of these issues. Note that while both of those articles are in the UIKit section, they also cover AppKit. Thanks, but unfortunately this does not work with the new icon styles. Best regards, Marc
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Sep ’25
Reply to Access .icon files in Swift or Objective-C
Enabling Include all app icon assets did the trick and I was able to access the icon by its name. Unfortunately, the icon is always rendered in its default appearance and does not adopt the current appearance, such as dark or tinted. Any chance to make this work? Is there a supported way to get the current appearance request the image in a specific appearance receive a notification if the appearance changes? The last point would also be necessary if I were using a regular asset set with PNG representations of the .icon file. Thanks, Marc
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Sep ’25
Reply to Access .icon files in Swift or Objective-C
Hi @DTS Engineer! Yes, the asset catalog is inside the plugin bundle and I can access other assets (png) without problems. To make things easier I created a simple app and added some .icon files to it. First I tried to access them using imageNamed: which doesn't work. Then I copied the icon files to the app's Resources folder, got the actual image path using [[NSBundle mainBundle] pathForResource:@"MyIcon" ofType:@"icon"] (which worked) and then to get an image using [[NSImage alloc] initWithContentsOfFile:iconPath] which returned null. So the issue is not about the Dock Tile plug in but a more general issue.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Sep ’25
Reply to Access .icon files in Swift or Objective-C
@DTS Engineer I actually want to use these .icon files in a Dock Tile plugin to change the icon of a Dock Tile depending on certain conditions. I added the files to the target, and the icons seem to find their way into the asset catalog, but I cannot access them.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Sep ’25
Reply to Access .icon files in Swift or Objective-C
Hi @DTS Engineer! Unfortunately this seems not to work anymore. I remember it worked until beta 3 or so but now the returned NSImage object is just null.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Sep ’25
Reply to WKWebView requires authentication
It turned out that the website uses Microsoft Enterprise SSO for authentication and my app's bundle identifier must be added to the AppAllowList in our Entra ID configuration. Microsoft describes this in the Enable SSO for specific apps section of their KB article Microsoft Enterprise SSO plug-in for Apple devices. After adding the app to that list, everything worked as expected.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to WKWebView requires authentication
@elementarteilchen The website is https://login.microsoftonline.com. It's a web form and WKWebView is configured to use persistent storage.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to NSAlert button background/contrast
Ok. But why do have some buttons a gray background and some a white one? Is this behavior is documented somewhere? That's the question I got from our accessibility folks…
Replies
Boosts
Views
Activity
Feb ’25
Reply to Local Authentication & localized reason string
At least for macOS I can say that it still needs that substring. If you look at the APP_ASKING_AUTH keys in /System/Library/Frameworks/LocalAuthentication.framework/Support/coreautha.bundle/Contents/Resources/UIAgent.loctable you'll see exactly this and all my tests with the Local Authentication framework have also confirmed this. Best regards, Marc
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to NSAlert button background/contrast
@DTS Engineer I already tried this, but it only changes the icon of the alert, but the way the buttons are displayed is identical.
Replies
Boosts
Views
Activity
Feb ’25
Reply to Local Authentication & localized reason string
Hi Quinn, opened feedback FB16445453. Best regards, Marc
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to Local Authentication & localized reason string
BTW: I had to upload the above list as an image because otherwise my post supposedly contained sensitive language. Very strange...
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to Local Authentication & localized reason string
Local Authorization's evaluatePolicy:localizedReason:reply: requires a partly localized reason, which is not ideal from a localization perspective. This is what the docs say: Application reason for authentication. This string must be provided in correct localization and should be short and clear. It will be eventually displayed in the authentication dialog as a part of the following string: "" is trying to . For example, if the app name is "TestApp" and localizedReason is passed "access the hidden records", then the authentication prompt will read: "TestApp" is trying to access the hidden records. What I found out now is, that the complete strings look as follows: Where the first placeholder contains the app name and the second placeholder contains the localized string the user provided. So I think I should be able to build the string I need. Best regards, Marc
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to LAContext and smart cards
During my testing it turned out that even if using Authorization Services, the Mac asks me for Touch ID. I always had in mind that this would only work using Local Authentication. So it seems that I don't have to use either one or the other but can build everything completely using Authorization Services. It asks me for Touch ID or PIN if a PIV token is connected, otherwise it asks me for Touch ID or Password.
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’25
Reply to LAContext and smart cards
If a smart card is paired to the account, the AuthenticationAuthority contains an additional entry like tokenidentity;29A5F37DB3E09402BFD231B306D5AB4099EBFE4E.
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’25