So far, we have had very little input from the user. She has launched the app and pressed a button, but the Watch is good for more than just presenting information. While the size of the screen makes some forms of input impractical, and text input via a keyboard must be top of that list, there are still many user input methods, both old and new at our disposal.
WatchKit's text input controller is a very simple way to gather text input (as the name might suggest) using the presentTextInputControllerWithSuggestions
method provided by WKInterfaceController
. When making this method call, you provide a list of text options from which the user may make a selection (she may also cancel, or choose voice input).
Firstly, we want to modify changeBorderColor()
to accept a String
argument which will tell it what color the user has selected. Replace the function as it stands with the following:
func changeBorderColor(colorString: String) { let newColor: UIColor ...