Add local port to watch settings

This commit is contained in:
Christoph Hagen
2024-05-25 16:08:51 +02:00
parent 91af68a44b
commit 3591842861
5 changed files with 17 additions and 8 deletions

View File

@@ -1,11 +1,11 @@
import SwiftUI
struct SettingsNumberInputView: View {
struct SettingsNumberInputView<Value>: View where Value: FixedWidthInteger {
let title: String
@Binding
var value: Int
var value: Value
@State
private var text: String = ""
@@ -16,7 +16,7 @@ struct SettingsNumberInputView: View {
VStack(alignment: .leading) {
TextField(title, text: $text)
.onSubmit {
guard let newValue = Int(text) else {
guard let newValue = Value(text) else {
return
}
value = newValue

View File

@@ -1,11 +1,11 @@
import SwiftUI
struct SettingsNumberItemLink: View {
struct SettingsNumberItemLink<Value>: View where Value: FixedWidthInteger {
let title: String
@Binding
var value: Int
var value: Value
let footnote: String