Here is some added code to ViewController.swift:
// Updates the shoe image's shown
func updateShoeImage() {
shoeSelection.image = UIImage(named: getShoeParams(type: type, gender: genderLbl.text ?? "", color: color))
}
// Sets the value of the text displayed on the UI regarding the parameters
func updateOrderResult() {
if name == "" || name == "Mr." || name == "Miss" {
if gender == "Boy" {
name = "Mr."
} else if gender == "Girl"{
name = "Miss"
}
}
orderResult.text = """
Hello \(name) I found this pair of \(type.lowercased()) shoes in \(color.lowercased()) size \(sizeLbl.text?.lowercased() ?? "")
"""
}
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: