I am running into some Swift 6 concurrency errors that I think are due to an odd oversight in the UIAccessibility Swift interface.
There are a number of constants defined in here for various things, most of which are marked "let" (appropriately).
However, the constants for notifications in extension UIAccessibility.Notification
are all marked as var for some reason. For example:
public static var pageScrolled: UIAccessibility.Notification
Because it is var, not let, anytime I try to access it, I get a concurrency violation. I am baffled as to how I am supposed to work around this.
For example, this line of code:
UIAccessibility.post(notification: .pageScrolled, argument: "test")
gives the error: "Reference to static property 'pageScrolled' is not concurrency-safe because it involves shared mutable state"
I can't for the life of me figure out how to work around this. I guess maybe define my own constant somewhere and suss out the rawValue somehow for now? This really needs to be fixed in the SDK.