From 32773a08eb11d286682ca8cad41171ce804f1631 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Wed, 31 May 2023 15:39:59 +0200 Subject: Works --- CCCB Display/ConfigController.swift | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 CCCB Display/ConfigController.swift (limited to 'CCCB Display/ConfigController.swift') diff --git a/CCCB Display/ConfigController.swift b/CCCB Display/ConfigController.swift new file mode 100644 index 0000000..92b6e37 --- /dev/null +++ b/CCCB Display/ConfigController.swift @@ -0,0 +1,35 @@ +// +// 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") + } +} -- cgit v1.2.3