How to make long text accessible - ios

I'm trying to make my app more accessible but I have a problem. Part of my app consists of pieces of advice, each composed of an UIScrollView with long text. (The text is a UIImage I prepared with Photoshop ).
I would like to make it accessible so that the users could listen to all the advice and pause it whenever they want. I thought of using UIAccessibilityLabel but the text is too long.
Thanks in advance for your help.

Let me preface this by saying I am not an iOS developer but am a long time blind iOS user.
There is no way to easily pause the reading of text and resume at the exact same spot that I know of. According to the documentation, I've found accessibilityLabel is meant to provide accessibility information that can be conveyed in under a sentence. An option I can think of would be to test whether VoiceOver is enabled using UIAccessibilityIsVoiceOverRunning. If this is true, you could put your text into a text view, and display that instead of your UIImage.
A textView will allow a VoiceOver user to read the text by character, word, or line, which is the best option available. If VoiceOver isn’t running, your test will return false, the UIImage will be displayed as normal, and the user won’t see anything different.

Related

Should I use UILabels?

I'll start developing a new project and my app will simulate a real machine. This real machine has a screen with approximately 150 mm.
This screen is used to insert data and to show some outputs to the user. It's like those printer's little screen. You know, with some options.
In order to replicate it in my app... Should I use a lot of UILables? One per line and column? Or, is there any other way to do it? What's the best practice?
Thank you
Well, if we look at Apple Documentation we'll see that
UILabel
A view that displays one or more lines of read-only text, often used in conjunction with controls to describe their intended purpose.
So that means that if you want just show some text to the user, UILabel is your choice. To be honest, I can't see how it's related to best practices, but if you weren't sure – this is okay to use UILabel for your case. You just need to set them up properly.
You can use more than 1 rule in 1 UILabel, by setting the amount of lines in the attribute inspector

Prevent Voiceover from reading UIAccessibility accessibilityLabel

I have a custom UIView subclass that displays text. The text can be in various languages, and I have audio for it. I don't want Voiceover to ever attempt to read the text itself, because I want the users to here my audio. I can set the accessibilityLabel of the element to an empty string, and play my audio in accessibilityElementDidBecomeFocused. However, I'm worried that this will be an issue for some users, because an alternative display wouldn't know how to display the text, the Item Chooser won't show the item, and I'm sure some other issues I haven't thought of.
Basically, I want to be able to give an accessibility element an accessibilityLabel, and have it be an active accessibilityElement, but NOT have VoiceOver read the label on focus.
As far as I know, this is impossible using current APIs. While you can change content when VoiceOver is running, you cannot distinguish how that content will be presented to the user, whether through speech, Braille keyboard, or other means.
Consider filing an enhancement request with Apple.
I asked a similar question in accessibility-dev#lists.apple.com and it was pointed out to me that Voice Over users set their personal playback voice and speed. Replacing it with your own audio will likely have a detrimental effect.

Stop voiceover reading a text

I have a long text on my view, when I tap on it VoiceOver reads the text.
Is there a default behavior to stop VoiceOver reading?
If not, is there a way to do it programmatically? for example when the view receive a tap.
Thanks in advance.
Without knowing the content or the interface it is difficult to give a solid answer to this question but one way to approach this problem it to try to not think of the experiences between a VoiceOver user and any other user as different experiences in the first place.
If you don't want VoiceOver users to repeatedly hear a long string of text you probably are also making the assumption that other users are going to be skipping over it after they have read it once as well.
Consider altering your interface so that the information is only presented once in a flow or is only presented when the user needs it and requests it, like contextual help.
Again, not knowing the interface or the purpose of the text makes it hard to answer this question directly but I generally find that building one interface to be inclusive of everyone often helps to point out that what might be perceived as just an Accessibility concern is actually a broader user experience concern and not just confined to the VoiceOver interface.
I hope that helps a little bit.

Custom Image iPhone Keyboard

Before this question is dismissed, let me start by saying I've read the dozens of questions that sound similar. I haven't found anyone that has asked for this specific use case, though, so I'm going to give it a shot.
I would like to create custom images to use (similar to emojis) in a custom keyboard that can be accessed with the globe icon. I understand that I can create a custom keyboard inside my own app, but it will only work within that app. I also understand how the emoji keyboard works.
Is it possible to create a situation where if two people are using the app, though, that the keyboard could be used to input the custom images (emojis) and be viewed only by a receiving user that ALSO has the app - even if the keyboard is being used outside of the custom image keyboard app.
So, basically, there would be a set of images stored within the app and the custom keyboard would reference those images to display whenever the keystroke has been entered and then the receiving phone can locate those images stored within the app to display them (but this could all be done within the native SMS messaging app, not solely in the new custom image keyboard app).
I've researched this a good deal, but can't find a straight answer. Any help or direction would be greatly appreciated!
You could create your own Keyboard that creates somehow special Strings that imply an image. For example could a smiley be encoded like ".CoolSmiley". When you now want to display that text, you should search for patterns you want to recognise. That's how emoji is working. When you type in (y) it will get replaced by a thumb up image because it's recognising the string as a known pattern for a thumb up. This will of course just work inside your app.

How do I go about building a native iOS rich text editor?

We want a native rich text editor because we are trying to stay away from using Javascript and webviews for this solution.
We've tried many things so far, and we're left with quite a few obstacles that we just can't get around. Let me break it down into questions that I hope you can answer.
I have a UIButton, that says "B" on it, and I want to put it into the 'selected' state when a user sets 'Bold' from using the TextView's long-press gesture on a selection. How do I register for this state change? I tried adding an observer on the textView.attributedText, but it doesn't seem they are changing that dictionary, but instead are updating it. NSDictionary has no way, as far as I know, to add observers on the dictionary's keys. So I'm stuck with noticing this change.
Regarding number 1, I also tried setting the textView's inputDelegate and it seems that the method - (void)textDidChange:(id )textInput never gets called. :( Docs says is should. What did I do wrong?
How do I update the attributedText weight when I hit my bold italic or underline button.
How do I convert my attributed text into HTML?
I saw a few neat libraries for number 4, but I'm still curious what you'd come up with. (Broadens my options). But, I can't really work on number 4 until I figure out how to do the previous 3.
This editor will also need hyperlinks, bulleted lists, and numbered lists, more things I imagine I'll struggle through, but if you could answer the 4 questions above, that will keep me held over for a while. :)
Thanks!
Here is a link to an iOS rich text editor I've been working on.
https://github.com/aryaxt/iOS-Rich-Text-Editor
There is still a lot of work that has to be done, but the basic features are there.
The Apple sample application called 'TextEdit' does much of what you've described and, if not that, would be a very good starting point. Find the sample code with a search in the Organizer.
There is a commercial editor based on the DTCoreText library. I've used that library but not the rich text editor. Look at the Cocoanetics web site. It's not cheap but will save you a ton of work.

Resources