Sesame-iOS/Sesame-Watch Watch App/Settings/SettingsTextInputView.swift

34 lines
794 B
Swift
Raw Normal View History

2023-08-09 16:29:18 +02:00
import SwiftUI
struct SettingsTextInputView: View {
let title: String
@Binding
var text: String
let footnote: String
var body: some View {
VStack(alignment: .leading) {
TextField(title, text: $text)
.foregroundColor(.accentColor)
Text(footnote)
.font(.footnote)
.foregroundColor(.secondary)
Spacer()
}
.navigationTitle(title)
.navigationBarBackButtonHidden(false)
}
}
struct SettingsTextInputView_Previews: PreviewProvider {
static var previews: some View {
SettingsTextInputView(
title: "Title",
text: .constant("Text"),
footnote: "Some more text explaining the purpose of the text field.")
}
}