Post

Replies

Boosts

Views

Activity

Reply to SwiftUI List on maCOS: highlighting content in the selected row?
This is a macOS related thing. I have chased this forever in vain. This is akin to NSCell.isHighlighted or NSCell.backgroundStyle I for sure want to use some special colors when not in highlight mode. A cell will be first highlighted in mouse down and than eventually selected on mouse up. So apple has to provide an API or an environment value to indicate to our row view that is highlighted or not. Maybe @eskimo can look up the source for this and shed some deep insight.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
Reply to SwiftUI List on maCOS: highlighting content in the selected row?
This is a macOS issue, ie: NSView.BackgroundStyle We have no way of telling inside a SwiftUI view that we are just highlighted. The user can highlight/un-highlight a bunch of rows during a mouse down, mouse drag sequence, but they are not selected yet until you release the mouse. A very cool AppKit feature. Maybe @Eskimo can Shed some deep insights on how this migrates to SwiftUI.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
Reply to A bug in Xcode lldb debugger for swift
For me the code is in the app. (lldb) po rv error: expression failed to parse: error: <EXPR>:3:1: error: cannot find 'rv' in scope rv ^~ (lldb) fr v rv (WhatSize.SideBarItemReducer.State) rv = <variable not available> // the code I'm trying to debug let rv = SideBarItemReducer.State.init(item: item) .preserveUIState(sideBarItemState) return rv What's not so funny is that rv has the proper data in the Variables View, but I love command line short cuts. Not a show stopper but a huge annoyance. Xcode 14.3.1 (14E300c) Thanks.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’23
Reply to How to access files when running XCTests in Ventura. Currently I receive "unauthorised access" errors.
No issues with official Xcode ie: 14.3.1, but FDA issues when running Xcode 15 Beta 5 ... As I'm falling in love with SPMs, I tend to write tests right in the SPM package. These tests will run inprocess of /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/xctest. Just put a break point in your testXXX() and po Bundle.main.executablePath to verify. Adding Xcode 15 Beta 5 to FDA did nothing, where Xcode 14.3.1 is not even on the FDA list. Went back to 14.3.1 and my tests do work again. Peace.
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’23
Reply to Migrating from pkg installer to Service Management
Amazing. I wanted to upgrade my privileged helper form SMJobBless to SMAppService.daemon. Read the existing code from UpdatingYourAppPackageInstallerToUseTheNewServiceManagementAPI, ok it was nice and simple. Well I wanted to do a bit more, after all apple tells me SMJobBless is deprecated and I should look into the SMAppService class So I made this change class func register() { let service = SMAppService.daemon(plistName: "com.xpc.example.agent.plist") do { try service.register() print("Successfully registered \(service)") } catch { print("Unable to register \(error)") exit(1) } } Made sure to have the plist under $APP.app/Contents/Library/LaunchDaemons/com.xpc.example.agent.plist Boom, I immediately hit the wall. Apple sends me a not so useful error Unable to register Error Domain=SMAppServiceErrorDomain Code=3 "No such process" UserInfo={NSLocalizedFailureReason=No such process} Common guys, instead of riddles, give us better examples, more examples, that cover more than 1% of the functionality.
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’24
Reply to SMAppService.daemon as root
This did not answer the original question on how to run a system daemon (or a root daemon). As to That post creates an agent, but the setup for a daemon is very similar these comments are debatable. Provide an example of SMAppService.daemon(plistName:) and let us decide if it's easy.
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’24
Reply to Migrating from pkg installer to Service Management
I'm struggling to understand expectations on happy path and posting here for others in case they wonder. I have no sand boxed apps I create valid/signed/notarized MyTest.pkg with a post install script Distribute the package to end users They install it sudo installer -verbose -pkg MyTest.pkg -target / will install my new app End user runs the new app, which calls /Applications/MyTest.app/Contents/MacOS/MyTest register We get Operation not permitted This will also add an entry on the System Settings -> General - > Open at Login or ask the user to enable this item on right corner user notifications. Since we failed on 5, we call /Applications/MyTest.app/Contents/MacOS/MyTest status We get SMAppServiceStatus.SMAppServiceStatusRequiresApproval Now our app asks the user to allow our item that was magically added on the step 7 We are good to go and can now call our elevated privileged app or XPC. After a lot of fiddling with this new API, this seems to be making sense. Apple does not want us to do all this and not give the end user a final say. After all this work DO I still have to ask the end user to allow full disc access ?
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’24
Reply to Instruments can't find the source code for selected symbol
I had the same vexing problem and remembered that often this is due to macOS caching. Since for example it will work for new projects. Removed all Xcode caches ~/Library/Developer/Xcode/DerivedData/ Rebooted, I also suspect a log out/log in will do. Rebuild and profiled my app and the source is there, tada.
Replies
Boosts
Views
Activity
Nov ’22
Reply to SwiftUI List on maCOS: highlighting content in the selected row?
This is a macOS related thing. I have chased this forever in vain. This is akin to NSCell.isHighlighted or NSCell.backgroundStyle I for sure want to use some special colors when not in highlight mode. A cell will be first highlighted in mouse down and than eventually selected on mouse up. So apple has to provide an API or an environment value to indicate to our row view that is highlighted or not. Maybe @eskimo can look up the source for this and shed some deep insight.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to SwiftUI List on maCOS: highlighting content in the selected row?
This is a macOS issue, ie: NSView.BackgroundStyle We have no way of telling inside a SwiftUI view that we are just highlighted. The user can highlight/un-highlight a bunch of rows during a mouse down, mouse drag sequence, but they are not selected yet until you release the mouse. A very cool AppKit feature. Maybe @Eskimo can Shed some deep insights on how this migrates to SwiftUI.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to issues with app package installation reporting failure and app mistakenly installed under "App Name.localized" parent directory
We want to change the bundle id, say the user has V7 of the app and we are installing V8. And it makes sense to install it in the same exact location. Unfortunately attempting to remove existing /Application/App during the 'preinstall' does not help.
Replies
Boosts
Views
Activity
Mar ’23
Reply to SwiftUI TextEditor autoscrolling
You can write a custom NSViewRepresentable to reach down to AppKit You can search for an SPM git package called introspect
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to A bug in Xcode lldb debugger for swift
For me the code is in the app. (lldb) po rv error: expression failed to parse: error: <EXPR>:3:1: error: cannot find 'rv' in scope rv ^~ (lldb) fr v rv (WhatSize.SideBarItemReducer.State) rv = <variable not available> // the code I'm trying to debug let rv = SideBarItemReducer.State.init(item: item) .preserveUIState(sideBarItemState) return rv What's not so funny is that rv has the proper data in the Variables View, but I love command line short cuts. Not a show stopper but a huge annoyance. Xcode 14.3.1 (14E300c) Thanks.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to How to access files when running XCTests in Ventura. Currently I receive "unauthorised access" errors.
No issues with official Xcode ie: 14.3.1, but FDA issues when running Xcode 15 Beta 5 ... As I'm falling in love with SPMs, I tend to write tests right in the SPM package. These tests will run inprocess of /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Agents/xctest. Just put a break point in your testXXX() and po Bundle.main.executablePath to verify. Adding Xcode 15 Beta 5 to FDA did nothing, where Xcode 14.3.1 is not even on the FDA list. Went back to 14.3.1 and my tests do work again. Peace.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Possible MacOS SwiftUI onFocusChange bug
Yup the same bug ... A trivial feature that somehow does not work.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to Resetting mac location permission
My solution was found on superuser.com questions/526183 since apple does allow me to post the entire url. you basically make a copy of clients.plist, convert it to xml, edit to remove the app you do not like, convert it to binary, restart killall locationd
Replies
Boosts
Views
Activity
Nov ’23
Reply to A VZMacGraphicsDisplayConfiguration with a large resolution causes macOS Ventura to incorrectly draw its menu bar items.
Still there in 13.6.5, I wanted to debug some code in Ventura and fired up a VM.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to How to delete certificates?
I added a second Developer ID Installer and I can't revoke the second one, not a big deal but yea it's not perfect. Now I have 2 of them.
Replies
Boosts
Views
Activity
Jun ’24
Reply to Migrating from pkg installer to Service Management
Amazing. I wanted to upgrade my privileged helper form SMJobBless to SMAppService.daemon. Read the existing code from UpdatingYourAppPackageInstallerToUseTheNewServiceManagementAPI, ok it was nice and simple. Well I wanted to do a bit more, after all apple tells me SMJobBless is deprecated and I should look into the SMAppService class So I made this change class func register() { let service = SMAppService.daemon(plistName: "com.xpc.example.agent.plist") do { try service.register() print("Successfully registered \(service)") } catch { print("Unable to register \(error)") exit(1) } } Made sure to have the plist under $APP.app/Contents/Library/LaunchDaemons/com.xpc.example.agent.plist Boom, I immediately hit the wall. Apple sends me a not so useful error Unable to register Error Domain=SMAppServiceErrorDomain Code=3 "No such process" UserInfo={NSLocalizedFailureReason=No such process} Common guys, instead of riddles, give us better examples, more examples, that cover more than 1% of the functionality.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to SMAppService.daemon as root
This did not answer the original question on how to run a system daemon (or a root daemon). As to That post creates an agent, but the setup for a daemon is very similar these comments are debatable. Provide an example of SMAppService.daemon(plistName:) and let us decide if it's easy.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to .pkg Installer removes previous version of the app before new installation
man pkgbuild read on BundleHasStrictIdentifier
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to Migrating from pkg installer to Service Management
I'm struggling to understand expectations on happy path and posting here for others in case they wonder. I have no sand boxed apps I create valid/signed/notarized MyTest.pkg with a post install script Distribute the package to end users They install it sudo installer -verbose -pkg MyTest.pkg -target / will install my new app End user runs the new app, which calls /Applications/MyTest.app/Contents/MacOS/MyTest register We get Operation not permitted This will also add an entry on the System Settings -> General - > Open at Login or ask the user to enable this item on right corner user notifications. Since we failed on 5, we call /Applications/MyTest.app/Contents/MacOS/MyTest status We get SMAppServiceStatus.SMAppServiceStatusRequiresApproval Now our app asks the user to allow our item that was magically added on the step 7 We are good to go and can now call our elevated privileged app or XPC. After a lot of fiddling with this new API, this seems to be making sense. Apple does not want us to do all this and not give the end user a final say. After all this work DO I still have to ask the end user to allow full disc access ?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’24