Skip to content

Commit

Permalink
Merge pull request #31 from mwaqasbhati/feature/Issue#30
Browse files Browse the repository at this point in the history
text editor added
  • Loading branch information
divadretlaw authored Oct 31, 2024
2 parents f5cfc92 + 71d6e7e commit d9fb304
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion Demo/Demo/Alerts/InputAlerts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
}
Expand Down

0 comments on commit d9fb304

Please sign in to comment.