34 lines
794 B
Swift
34 lines
794 B
Swift
|
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.")
|
||
|
}
|
||
|
}
|