From 71d6e7e530110a64a00e2cb4286b125b9630b6bd Mon Sep 17 00:00:00 2001 From: Muhammad Waqas Date: Wed, 30 Oct 2024 00:13:47 +0400 Subject: [PATCH] text editor added --- Demo/Demo/Alerts/InputAlerts.swift | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Demo/Demo/Alerts/InputAlerts.swift b/Demo/Demo/Alerts/InputAlerts.swift index 0e677dd..9f3daec 100644 --- a/Demo/Demo/Alerts/InputAlerts.swift +++ b/Demo/Demo/Alerts/InputAlerts.swift @@ -11,7 +11,9 @@ import CustomAlert struct InputAlerts: View { @State private var showTextField = false @State private var text = "" - + @State private var showTextEditor = false + @State private var editorText = "" + var body: some View { Section { Button { @@ -34,6 +36,28 @@ struct InputAlerts: View { Text("Cancel") } } + + Button { + showTextEditor = true + } label: { + DetailLabel("TextEditor", detail: "CustomAlert with a TextEditor") + } + .customAlert("TextEditor", isPresented: $showTextEditor) { + TextEditor(text: $text) + .font(.body) + .padding(4) + .frame(height: 100) + .background { + RoundedRectangle(cornerRadius: 8) + .fill(Color(uiColor: .systemBackground)) + } + } actions: { + Button(role: .cancel) { + print("Input.TextEditor - Cancel") + } label: { + Text("Cancel") + } + } } header: { Text("Input") }