Skip to content

Commit 2bdb3fa

Browse files
committed
EditableLabel initialiser accepting SwiftUI images
1 parent ac0b7e9 commit 2bdb3fa

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Sources/ProjectNavigator/EditableLabel.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ public struct EditableLabel: View {
1818

1919
@FocusState private var isFocused: Bool
2020

21+
/// A label whose text can be edited.
22+
///
23+
/// - Parameters:
24+
/// - text: The label text.
25+
/// - image: Image to use for the label.
26+
/// - editedText: If non-nil, this text is being edited, while the label text is not shown.
27+
///
28+
/// Editing is aborted and the text before editing restored on exit.
29+
///
30+
public init(_ text: String, image: Image, editedText: Binding<String?>) {
31+
self.text = text
32+
self.image = image
33+
self._editedText = editedText
34+
}
35+
2136
/// A label whose text can be edited.
2237
///
2338
/// - Parameters:

0 commit comments

Comments
 (0)