SwiftUI 2 Xcode 12 Still No Voice Entry with TextField Nor TextEditor

Viewed 263

I had some discussion here on SO once before when I first learned that voice entry in SwiftUI TextFields does not work. I am way more discouraged to find that voice entry in iOS 14 TextField and TextEditor still does not work. In fact, the entire app crashes immediately upon tapping the keyboard microphone button.

Since I believe that Apple truly encourages accessibility features, I have to believe that I am missing some setup code to allow this feature. (I have listed microphone usage in the plist file.)

I still use my own UIRepresentable UITextField and UITextView objects but it is truly painful when these new objects should work. Here is a really simple example with the new code.

struct ContentView: View {

    @State private var fieldOne = "This is the TextField"
    @State private var viewOne = "This is the TextEditor"

    var body: some View {
        VStack {
            Text("Some Heading").padding()
            TextField("Some text", text: $fieldOne)
                .padding(.all, 10)
            TextEditor(text: $viewOne)
                .padding(.all, 10)
            Text("After the text view")
                .padding(.all, 10)
                .multilineTextAlignment(.center)
        }
    }
}

You can comment out any combination of the views - the behavior is the same.

The console reports the following just by tapping into the TextEditor:

2020-06-29 16:46:29.165522-0700 CheckTextTypesForVoice[1444:604018] Creating client/daemon connection: 6B878753-D5E7-4010-8EF5-84494644E8B8 2020-06-29 16:46:29.239411-0700 CheckTextTypesForVoice[1444:604018] Got the query meta data reply for: com.apple.MobileAsset.LinguisticData, response: 0

above several times

2020-06-29 16:46:29.424819-0700 CheckTextTypesForVoice[1444:604018] Consumed extension 2020-06-29 16:46:29.428348-0700 CheckTextTypesForVoice[1444:604018] getLocalPath asset com.apple.MobileAsset.LinguisticData 6ae6ca4a7a41d5047dbf34aaf85a12e0abda1448 local path is '/private/var/MobileAsset/AssetsV2/com_apple_MobileAsset_LinguisticData/6ae6ca4a7a41d5047dbf34aaf85a12e0abda1448.asset/AssetData', exists: YES above twice 2020-06-29 16:46:29.535571-0700 CheckTextTypesForVoice[1444:604035] Got the query meta data reply for: com.apple.MobileAsset.LinguisticData, response: 0

above twice

Then tapping the microphone:

2020-06-29 16:47:45.331066-0700 CheckTextTypesForVoice[1444:603711] Metal API Validation Enabled

2020-06-29 16:47:45.440014-0700 CheckTextTypesForVoice[1444:603711] -[MTLDebugRenderCommandEncoder setViewport:], line 2665: error 'Viewport Validation viewport.znear(-1) must be between 0.0f and 1.0f ' -[MTLDebugRenderCommandEncoder setViewport:]:2665: failed assertion Viewport Validation viewport.znear(-1) must be between 0.0f and 1.0f ' -[MTLDebugRenderCommandEncoder setViewport:]:2665: failed assertion Viewport Validation viewport.znear(-1) must be between 0.0f and 1.0f ' (lldb)

Any guidance would be appreciated. Xcode 12.0 beta, iOS 14.0 beta

0 Answers
Related