-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AccessibilityDependency (UIAccessibility abstraction) #26
Add AccessibilityDependency (UIAccessibility abstraction) #26
Conversation
c68a6b8
to
fa9fa58
Compare
* Created dependency module for UIAccessibility framework * Supported features/modes - VoiceOver - Mono audio - Closed captioning - Invert colors - Guided access - Bold text - Button shapes - Grayscale - Reduce transparency - Reduce motion - Reduce motion: prefer cross-fade transitions - Video autoplay - Darker system colors (increase contrast) - Switch control - Speak selection - Speak screen - Shake to undo - Assistive touch - On/Off switch label - Differentiate without color - Hearing device paired ear * Supported UIAccessibility functions - UIAccessibility.convertToScreenCoordinates - UIAccessibility.focusedElement - UIAccessibility.post - UIAccessibility.requestGuidedAccessSession * Accessibility Dependency ddocumentation mirrors UIKit's UIAccessibility documentation
fa9fa58
to
e452c5b
Compare
@tgrapperon I'd like to think that I can just slap on some pragmas for iOS and tvOS since I didn't see any UIAccessibility functionality that is platform-specific, but I imagine there's a few functions or variables that are only available in one platform. When you were creating the UIApplication or UIDevice abstractions, what was your process for finding the functionality that was available in one platform but not the other? |
Hey @acosmicflamingo! Wow, thanks, very impressive, and something that could definitely be useful. Congrats for getting the I didn't had the time to go through properly, and I'm heading to bed right now, but a few comments:
There are many things in the library that I didn't had the time to explain yet, so if that's OK with you, I'll take over from now and I'll update this PR with the changes I have in mind, and I'll let you know once I'm done, so you can check if it still fits what you had in mind. But this is a great idea and a great working base, and surely something that will be very useful when it'll land. Thanks again! |
I looked at the documentation and interface files, and the unavailable ones that I missed were caught when trying to build for these platforms. |
@tgrapperon Woohoo! Glad to hear this :) Hahah like isowords, a lot can be learned just by jumping into the deep end so ConfigurableProxy wasn't hard to grasp after looking at how you designed UIDevice & UIApplication. If anything, it felt like plagiarism since UIApplication and UIAccessibility are very similar in structure. As for your points:
/// A Boolean value that indicates whether VoiceOver is in an enabled state.
///
/// You can use this function to customize your app’s UI specifically for VoiceOver users.
/// For example, you might want UI elements that usually disappear quickly to persist
/// onscreen for VoiceOver users.
///
/// Note that you can also listen for the
/// ``voiceOverStatusDidChangeNotification`` notification to determine
/// when VoiceOver starts and stops. In the spirit of utilizing the Dependencies library,
/// the voiceOverStatusDidChangeNotification property is located within
/// `@Dependency(\.notification) var notification`, which can be utilized after
/// importing `_Notification` in your codebase
@MainActor
@available(iOS 4.0, *)
public var isVoiceOverRunning: Bool {
_implementation.isVoiceOverRunning
}
Yeah I don't have a problem with you taking over from here :) I wanted to do this myself since I imagine you have tons in your backlog already and don't want to be that person who creates a Github issue asking "WHERE IS ACCESSIBILITY DEPENDENCY??? MAKE IT NOW" when I could just write up my implementation and create a PR for it. But yeah, DependencyAdditions is your project so as the maintainer, you do what you want! If you need help with anything though, you can certainly ask and I can do what I can! Thanks @tgrapperon for all your effort in TCA, Dependencies, and open source in general :D |
Hey @acosmicflamingo!
If this is fine with you, we can merge. |
@tgrapperon WHOA! You really took it to the next level :D I am all for the changes you had made, and even find it funny that the snippet I wrote in the README in hindsight is pretty useless compared to your more practical one. I also made Go ahead and merge this as-is :) thanks for your really constructive feedback and your time to get this to tip-top shape 🥇 Woohoo!!! |
Thank you for your PR, it will help many folks for sure! |
Anytime! Sounds good 😃 |
Created dependency module for UIAccessibility framework
Supported features/modes
Supported UIAccessibility functions
Accessibility Dependency ddocumentation mirrors UIKit's UIAccessibility documentation