Accessibility

RSS for tag

Make your apps function for a broad range of users using Accessibility APIs across all Apple platforms.

Posts under Accessibility tag

137 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Swift Chart Zoom/Magnification/Pinch Gesture
Is there any approach or sample code available to use these APIs: .chartScrollableAxes(.horizontal) .chartScrollPosition(x: ...) .chartScrollPosition(initialX: ...) .chartScrollTargetBehavior(...) .chartXVisibleDomain(length: ...) Plus a gesture recognised or Pinch or Magnification to create a Swift Chart with an X axis that can be zoomed in or out with a pinch gesture? And when zoomed in at any level above 0, the chart can then be scrolled left to right along the X axis. I've had success using .chartScrollableAxes with .chartXSelection in parallel, so would also like to keep the ability to select X values too.
1
1
1.1k
Jul ’24
EXC_BAD_ACCESS in AXSerializeCFType
I have an Electron app on macOS Sonoma (arm64 arch). It has a native addon (app.node) using node-addon-api. Recently it crashed, with the stack trace (given below). What is the AXSerializeCFType function inside the AXUIElementCopyAttributeValue function, and why did it crash there? AXUIElementRef systemWideElement = AXUIElementCreateSystemWide(); AXUIElementRef focusedApp = NULL; AXError error = AXUIElementCopyAttributeValue(systemWideElement, kAXFocusedApplicationAttribute, (CFTypeRef *)&focusedApp); The crash appears to be occurring in the last line of the code, where I am retrieving the focused app AXUIElementRef using AXUIElementCopyAttributeValue. I have already attempted to manually set systemWideElement to NULL, but AXUIElementCopyAttributeValue is not crashing; it is just returning an error kAXErrorIllegalArgument. OS Version: macOS 14.5 (23F79) Report Version: 104 Crashed Thread: 344454 Application Specific Information: Fatal Error: EXC_BAD_ACCESS / KERN_INVALID_ADDRESS / 0x102674000 Thread 344454 Crashed: 0 HIServices 0x18cb5d970 AXSerializeCFType 1 HIServices 0x18cb7ca24 serializeWrapper 2 HIServices 0x18cb7cd40 _AXXMIGCopyAttributeValue 3 HIServices 0x18cb74884 _AXUIElementCopyAttributeValue 4 HIServices 0x18cb74a04 AXUIElementCopyAttributeValue 5 HIServices 0x18cb747fc _AXUIElementCopyAttributeValue 6 HIServices 0x18cb74a04 AXUIElementCopyAttributeValue 7 app.node 0x1027a56f4 getFocusedApplication
2
1
649
Jul ’24
AccessibilityUIServer has microphone locked
Just installed iOS 18 Beta 3. I am seeing my AccessibilityUIServer using the microphone and this is causing no notification sounds, inability to use Siri by voice and volume is grayed out. If I start to play anything with sound AccessibilityUIServer releases the microphone and I am able to use the app. Calls still work since AccessibilityUIServer will release and the phone will ring. Feed back ID is FB14241838.
12
9
6.2k
Sep ’24
Issues Supporting All Accessibility Features with a Custom Font
I am in the process of adding my company's brand font to our SwiftUI app. I am able to implement the font using the provided public APIs so that text styles / dynamic type and the font weight modifier in SwiftUI work correctly. However we are unable to implement custom font in such a way that text styles / dynamic type, the font weight modifier, and the bold text accessibility setting all work at the same time. Am I missing an implementation detail so that all these features work correctly? Font Setup The font files were modified to better support SwiftUI: The font style name metadata was modified to match the name the .fontWeight(...) modifier expects. This was done with Typelight. The font weight value (100/200/300) was modified so that the underlying weight value matches the value the .fontWeight(...) modifier expects. See "Using custom fonts with SwiftUI" by Matthew Flint. The font files were imported via the Info.plist. Examples Font Weight Comparison San Fransisco: Text("#100") .font(.largeTitle) .fontWeight(.ultraLight) Overpass by Name: Text("#100") .font(.custom("Overpass-UltraLight", size: 34, relativeTo: .largeTitle)) Overpass by Weight: Text("#100") .fontWeight(.ultraLight) .font(.custom("Overpass", size: 34, relativeTo: .largeTitle)) Legibility Weight Test When using the .fontWeight(...) modifier, the custom font does not change weights when the bold text accessibility setting is enabled. Dynamic type size works as expected. Normal legibility weight: Bold legibility weight: Dynamic Type Size: Use UIFont Using UIFont to load the custom font files and initializing a Font with the UIFont breaks dynamic type: Bold type also does not work: Custom Modifier Creating a custom modifier allows us to support dynamic type and manually handle bold text. However it creates a conflicting API to SwiftUI's .fontWeight(...) modifier. struct FontModifier: ViewModifier { enum UseCase { case paragraph case headline } enum Weight { case light case regular case heavy } @Environment(\.legibilityWeight) var legibilityWeight var useCase: UseCase var weight: Weight init(_ useCase: UseCase, _ weight: Weight) { self.useCase = useCase self.weight = weight } var resolvedHeadlineWeight: String { let resolvedLegibilityWeight = legibilityWeight ?? .regular switch weight { case .light: switch resolvedLegibilityWeight { case .regular: return "Light" case .bold: return "Semibold" @unknown default: return "Light" } case .regular: switch resolvedLegibilityWeight { case .regular: return "Regular" case .bold: return "Bold" @unknown default: return "Regular" } case .heavy: switch resolvedLegibilityWeight { case .regular: return "Heavy" case .bold: return "Black" @unknown default: return "Heavy" } } } var resolvedParagraphWeight: Font.Weight { switch weight { case .light: return .light case .regular: return .regular case .heavy: return .heavy } } var resolvedFont: Font { switch useCase { case .paragraph: return .system(.largeTitle).weight(resolvedParagraphWeight) case .headline: return .custom("Overpass-\(resolvedHeadlineWeight)", size: 34, relativeTo: .largeTitle) } } func body(content: Content) -> some View { content .font(resolvedFont) } } GridRow { Text("Aa") .modifier(FontModifier(.paragraph, .regular)) Text("Aa") .modifier(FontModifier(.paragraph, .heavy)) Text("Aa") .modifier(FontModifier(.headline, .regular)) Text("Aa") .modifier(FontModifier(.headline, .heavy)) } Font Environment Value The font environment value does not contain font weight information when the fontWeight(...) modifier is used.: struct DumpFontTest: View { @Environment(\.font) var font var body: some View { Text("San Fransisco") .onAppear { print("------------") dump(font) } } }
3
1
1.2k
Aug ’24
Updating Automation Intervals
It would greatly benefit the entire community if there was a "Once" button under the "automation" section that is apart of "shortcuts" app. Currently there are 3 selections - Daily, Weekly, Monthly. Please add a 4th selection - "Once" I'm asking because I was told that I could do this here. Thanks for anyone that supports this as I feel it would benefit us immensely.
1
0
547
Jul ’24
Seeking guidance on intercepting system-wide notifications in macOS app
I'm developing a macOS application called Blurt, which aims to provide enhanced notification management in MacOS. The core functionality I'm trying to implement is the ability to intercept and display notifications from various applications in a custom interface. Current implementation: Using AppDelegate to handle application lifecycle Implemented UNUserNotificationCenterDelegate for handling notifications Created a custom NotificationService extension Challenges: Unable to intercept notifications from other applications System notifications are not being captured by our app What I've tried: Using DistributedNotificationCenter to observe system-wide notifications Implementing a Notification Service Extension Exploring NSWorkspace notifications Current roadblocks: Apple's sandboxing and security model seems to prevent direct access to other apps' notifications Unable to find a sanctioned API for system-wide notification interception Questions: Is there a recommended approach to creating a centralized notification management system within Apple's guidelines? Are there any specific system notifications or events we can legally subscribe to that might help achieve similar functionality? How do other notification management apps (if any exist) handle this limitation? Are there any upcoming APIs or features in macOS that might address this use case? I'm open to alternative approaches or pivoting the app's functionality if necessary. Any insights, suggestions, or resources would be greatly appreciated. Thank you in advance for your help!
1
0
1.4k
Jul ’24
Xcode Accessibility audit in UI Tests gives less than stellar results
I have added a UI test that uses the newish app.performAccessibilityAudit() on each of the screens in my SwiftUI app. I get a handful of test failures for various accessibility issues. Some of them are related to iOS issues (like the "legal" button in a map view doesn't have a big enough tappable are; and, I think, there is a contrast issue with selected tabs in a tab bar, or maybe it is a false positive). Two of the error type I get are around Text elements that use default font styles (like headline) but that apparently get clipped at times and apparently "Dynamic Type font sizes are unsupported". For some of the errors it supplies a screenshot of the whole screen along with an image of the element that is triggering the error. For these text errors it only provides the overall image. After looking at the video I saw that part of the test runs the text size all the way up and I could see that at the largest size or two the text was getting cut off despite using default settings for the frames on all the Text elements. After a bit of trial and error I managed to get the text to wrap properly even at the largest of sizes and most of the related errors went away running on an iPhone simulator. I switched to an iPad simulator and the errors re-appeared even though the video doesn't show the text getting clipped. Does anyone have any tips for actually fixing these issues? Or am I in false positive land here? Also, is there any way to get more specific info out of the test failures? Looking at the entire screen and trying to guess where the issue is kinda sucks.
1
2
964
Jun ’24
iMessage content on iPhone displayed on SSH Bitvise Client on the Windows Laptop !
If "send and receive" on imessages has my Microsoft work email address, can my imessage content be synched with Microsoft ? Because I recently logged into our big data system through SSH client using my work email address, on a Console I saw one of my imessage thread printed. I reached Microsoft and their reply was to get advise reaching out to Apple support as their knowledge of iMessage is limited. Based on general knowledge about data protection the messages are most likely not synced unless there is a setting that you can allow from my side. PLEASE HELP ! This is a Mystery !!
1
0
710
Jun ’24
Caller does not have kTCCServiceVoiceBanking access to personal voices. No speech will be generated
Hello, I'm trying to leverage PersonalVoice to read a phrase in my iOS application. My implementation works correctly on an iPhone 15, but does not work when I run the iOS application on an M2 Macbook Air. Here are some snippets from my implementation // This is how I request Personal Voice AVSpeechSynthesizer.requestPersonalVoiceAuthorization() { status in if status == .authorized { var personalVoices = AVSpeechSynthesisVoice.speechVoices().filter { $0.voiceTraits.contains(.isPersonalVoice) } } } // this is how I'm attempting to read let utterance = AVSpeechUtterance(string:textToRead) if let voice = personalVoices.first { utterance.voice = voice } var synthesizer = AVSpeechSynthesizer() synthesizer.speak(utterance) I get the following error messages when I try this: Cannot use AVSpeechSynthesizerBufferCallback with Personal Voices, defaulting to output channel. Caller does not have kTCCServiceVoiceBanking access to personal voices. No speech will be generated Voice not allowed to render speech! Will not set up synthesizer. Bailing now Any suggestions on how to mitigate this issue?
0
0
787
Jun ’24
Accessibility : Full keyboard access with scroll view in swiftui
I have checked almost all previous question related to my query but did not find my solution. I'm facing issue with Full keyboard access accessibility when integrate it with scrollview. Inside scrollview textfield and secure textfield are accessible with "tab" key but other component like buttons are not accessible using "tab" key. but when I remove scrollview all elements are accessible with "tab" key. Even in system installed iOS Apps they don't support scrollview with tab button, I have analysed apple documentation regarding this but did not find specific to this. Does anyone have idea regarding this kind of behaviour?
1
1
848
Aug ’24
Why doesn't my app show up in the accessibility list?
Hello guys, In a macOS app developed with SwiftUI and swift, the NSAccessibility key has been added to the Info.plist file to explain why the app requires Accessibility permissions, and also the AXIsProcessTrustedWithOptions function has been called, but the app is not seen in the system's Accessibility list. I thought, it will show up in the system's Accessibility list like following Some of my code import SwiftUI @available(macOS 13.0, *) @main struct LOKIApp: App { @State private var activeWindow: NSWindow? = nil @State private var accessibilityGranted = false var body: some Scene { MenuBarExtra("App Menu Bar Extra", image: "trayicon") { Button("Settings") {} .keyboardShortcut("s") Divider() Button("Quit") { NSApplication.shared.terminate(nil) } .keyboardShortcut("q") }.menuBarExtraStyle(.menu) } init() { let options: NSDictionary = [kAXTrustedCheckOptionPrompt.takeRetainedValue() as NSString: true] let accessibilityEnabled = AXIsProcessTrustedWithOptions(options) if accessibilityEnabled == true { print("Accessibility is enabled") } else { print("Accessibility is not enabled. Please enable it in System Preferences") } } } I didn't do any other configuration, and test this app by using the command Command+R, need I set provisioning profile? Please help, thank you.
1
2
871
Oct ’24
How do I submit an UPDATE for my Sticker Pack in xCode 15??
I have 5 sticker packs in the App Store. I had an older Mac and it finally was too old for more MacOS updates and therefore too old to update xCode, so I haven't done any updates to my packs or looked at xCode in nearly 3 years. I FINALLY got a new Mac. I've got xCode 15 installed and with latest updates - and it looks so foreign! Things I can't find: Where in xCode can I change the version and build #? This used to be so obvious. I decided to start from scratch with my project. Clicked on new Sticker Pack App. Dragged in my icons and stickers and new updates I've created. When I went to archive, it says it can't because it already exists. Oh boy. In addition to this, I'm also lost on how to put in ALT tags for accessibility. This was also super obvious in the version of xCode I was using 3 years ago - I could click on each sticker and in the right pane I could put in the words for voice over for visually impaired. Now that is gone. One of my reviews thanked me for making my sticker pack accessible. I don't want to lose that ability - but I cannot find out where the heck it's hiding. The OnDemand Resource Tags definitely aren't it - since adding info in one puts the same tags on ALL the stickers.
5
0
1.2k
Sep ’24
How do I enable UILargeContentViewerInteraction on UITabBar outside of UITabBarController?
UILargeContentViewerInteraction, added in iOS 13, works out of the box on the tab bar in a UITabBarController, and it's easy to set up on a custom view using the UILargeContentViewerItem properties on UIView. But how do I set it up on a UITabBar that's not connected to a UITabBarController? There don't appear to be any relevant properties on UITabBarItem. To try this, I made a sample app, added a tab bar, set up some items, set their largeContentSizeImage properties for good measure, ran the app, set text size to a large accessibility value, and long-pressed on the items, and I get no large content viewer. I also tried adding a UILargeContentViewerInteraction to the tab bar, and implemented the viewControllerForInteraction method in the delegate.
3
1
1.3k
Sep ’24
On iOS 16, VoiceOver will not speak "¥1,230" in Japanese.
In iOS 16, VoiceOver no longer speaks numbers such as “¥1,230" in Japanese, which worked correctly in iOS 15 and earlier. This is a very important bug in Accessibility support. Steps to reproduce Create iOS App Project on Xcode. (I used Xcode 14) Set the Development Localization to "Japanese" on the project settings. (to make VoiceOver speak Japanese) For example, write the following code. Build and run the App targeting the actual device, not the simulator. Actual devices running iOS 15 or earlier will correctly read out loud with VoiceOver, while iOS 16 will have some reading problems. import SwiftUI @main struct VoiceOverProblemApp: App {   var body: some Scene {     WindowGroup {       // on project settings, set the development localization to Japanese.       VStack {         // ✅ said "Hello, world!"         Text("Hello, world!")                   // ✅ said "残高 (ざんだか, zan-daka)"         Text("残高")                   // ❌ said nothing (until iOS 15 or earlier, said "千二百三十円 (せんにひゃくさんじゅうえん, sen-nihyaku-san-ju-yen)"         Text("¥1,230")                   // ❌ said wrong         //  correct (iOS 15 or earlier):  "残高は千二百三十円です (zan-daka wa sen-nihyaku-san-ju-yen desu)"         //  incorrect (iOS 16)      : "残高はです (zan-daka wa desu)"         Text("残高は ¥1,230 です")       }     }   } } The above sample code uses SwiftUI's Text but the same problem occurs with UIKit's UILabel.
1
0
1.1k
Apr ’25
Accessibility permission in sandboxed app
Is it possible to create a sandboxed app that uses accessibility permission? And if so, how do I ask the user for that permission in a way that is allowed by the App Store? Im creating a small menubar app and my current (rejected) solution is to create a pop-up, with link to Security & Privacy > Accessibility and the pop-up asks the user to manually add the app to the list and check the checkbox. This works in sandbox. Reason for rejection: "Specifically, your app requires to grant accessibility access, but once we opened the accessibility settings, your app was not listed." I know it's not listed there and it has to be added manually. But its the only solution I've found to this issue. Is there perhaps any way to add the app there programmatically? Im a bit confused since I've seen other apps in App Store that work the same way, where you have to add the app to the list manually. Eg. Flycut. :man-shrugging: I know about this alternative solution, and it's not allowed in sandboxed apps. It also adds the app to the accessibility list automagically: func getPermission() { AXIsProcessTrustedWithOptions([kAXTrustedCheckOptionPrompt.takeUnretainedValue():true] as CFDictionary). } Does anyone have a solution for this? Best regards, Daniel
7
2
4.5k
Sep ’24