Adding a Footer View to display more information
The Footer view that we will add will contain two pieces of information – first, how many words the user has found so far, and second, what their letter average is for each found word.
To do this, create a new SwiftUI View file and call it FooterView
. This will contain the Text
views we need to display that information.
Now let’s get to work and add some code. Add the following properties inside the FooterView
struct:
struct FooterView: View { //MARK: - PROPERTIES @ObservedObject var appData = DataModel() @Binding var userEnteredWordsArray: [String] var foundWords: Double { let wordCount = userEnteredWordsArray.count //if theres no words in the array, return 0 ...