0

The iOS13 Voice Control feature has a command 'Scroll Down'. This command works for UITableViews but does not seem to work for UIScrollViews with scrollable content.

  1. Is this intended?
  2. Intended or not, is there a way to enable this command to work on a UIScrollView?

Example: a UILabel with a lot of text inside a UIScrollView (constraints are correct - it scrolls and is acknowledged by Voice Over saying 'Page 1 of 3' when active)

enter image description here

Wych
  • 13
  • 3
  • 6

1 Answers1

0

This command works for UITableViews but does not seem to work for UIScrollViews with scrollable content.

... only if this content is a huge UILabel content that must be scrollable: add many other elements (sliders, buttons...) and you'll notice that scrolling is enabled.

About that, in the TextKit Best Practices (2018 WWDC video), it's highly recommended to use a UITextView for this purpose: enter image description here

Is there a way to enable this command to work on a UIScrollView?

Switch the label and your scroll view for a text view instead to make the Voice Control feature work with your specific use case.

Otherwise, it works with many other elements different from UILabel: the scroll view knows its content size and when it has to scroll down/up but the Voice Control feature doesn't recognize the label content as an element to directly interact with inside a scroll view.

I tested with a button and a huge UILabel as you did: enter image description here

  1. Scroll down that worked to reach the end of my label.
  2. Scroll up that never works.

The label seems to be a kind of empty box that Voice Control ignores in a scroll view: to enable this command in a scroll view, just replace your label by a text view.
Now, if your use case is a single UILabel in a UIScrollView, remove them to display a UITextView instead.

EDIT
Here's the Xcode screenshot to make the UITextView scrolling work with the VoiceControl feature: enter image description here

... with the results hereunder: enter image description here

As you can notice, this is just a blank project with a simple text view: iOS recognizes this single element and acts as desired when Scroll down and Scroll up are vocalized.

XLE_22
  • 5,124
  • 3
  • 21
  • 72
  • If I replace the ScrollView + UILabel with a UITextView it still doesn't scroll with the Voice Control though. Did you manage to get that to work? Right now I just have a blank ViewController with a UITextView constrained to top/bottom/left/right of the View. Great thought on the label just being a kind of empty element in the scrollview too! – Wych Jan 09 '20 at 01:20
  • @Wych: it works well as the added screenshots highlight. Just create a blank project and add your text view with your constraints and personal content. – XLE_22 Jan 09 '20 at 09:54
  • @xle-22 ah yep I can reproduce your functionality from a blank UITextView, but if you make it not Editable the voiceover stops working as intended. Seems it acts the same as a UILabel in a ScrollView in this regard? – Wych Jan 10 '20 at 02:20