// // ConfigController.swift // CCCB Display // // Created by Dirk Engling on 26.05.23. // import Foundation import UIKit class ConfigController: UIViewController { @IBOutlet weak var display_address: UITextField! override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) let defaults = UserDefaults.standard if let ip = defaults.string(forKey: "Display_Address") { display_address.text = ip } else { display_address.text = "172.23.42.29" } } @IBAction func cancelPressed(_ sender: Any) { self.dismiss(animated: true) } @IBAction func donePressed(_ sender: Any) { self.dismiss(animated: true) let defaults = UserDefaults.standard defaults.set(display_address.text, forKey: "Display_Address") } }