Creating a settings screen
Now that we can set the word length, let’s put together the settings view so that the user can click on the info button and actually change the language from there. We want to create three buttons – one for each language – and a fourth button, the Done button, which users can use to complete their selection and dismiss the page.
So, inside SettingsView
, we’ll first need a variable to access DataModel
. Add this observed object variable at the top of the SettingsView
struct:
@ObservedObject var appData = DataModel()
Next, let’s add a title for this page called Language Settings
in the body
property:
VStack { Text("Language Settings") .font(.title).bold() .padding(.top, 20) &...