Post

Replies

Boosts

Views

Activity

Reply to Removing/hiding a tracking separator toolbar item
It looks like I've solved the problem by saving the separator item when I see it in toolbarWillAddItem, and then returning it from toolbar(_:itemForItemIdentifier:willBeInsertedIntoToolbar:) to avoid having a new instance created. That way, removing and re-adding the item works without having exceptions thrown. The last little snag was to not remove and re-add the separator blindly. The window state may have been preserved across app launches, so I needed to not make assumptions about how the window would initially appear.
May ’21
Reply to Communicating between app & test runner
The solution I ended up going with is the app opens a socket to listen on, writes out the port it got to a file in SIMULATOR_SHARED_RESOURCES_DIRECTORY, and the test runner reads that file and connects to the port. I tried using a unix domain socket, but (as the app itself is in C#) the .NET API for that kept throwing PlatformNotSupportedException. I really don't know if there was a real error or if .NET just thinks iOS doesn't support domain sockets. My approach did still require adding an entitlement, so I'll just have to modify my build script to only include that in the debug build.
Mar ’24