Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use TextInput for WatchOS in swiftUI

Typically I would use presentTextInputControllerWithSuggestions() to show the TextInput field. But this isn't available in swiftUI because it is a function of WKInterfaceController. Do I have to use the WKInterfaceController for this? I couldn't find anything in the documentation.

like image 413
Celina Avatar asked Jul 05 '19 12:07

Celina


People also ask

How to develop apps for watchOS?

To build a watch-only app, start a new project in Xcode, select the Watch App template, and click Next. Provide a name, and choose the interface, life cycle, and language for your watch app. Select the options to include a notification scene template or unit and user interface tests, and click Next.

How do I change TextField background color in Swiftui?

TextField view doesn't provide a way to add background color but we can use the background modifier to add color to the TextField.

What is a text field on Iphone?

A control that displays an editable text interface. iOS 13.0+ iPadOS 13.0+ macOS 10.15+ Mac Catalyst 13.0+ tvOS 13.0+ watchOS 6.0+


1 Answers

This would be done through a TextField in SwiftUI.

like image 99
Austin Conlon Avatar answered Sep 19 '22 21:09

Austin Conlon