Skip to content

Commit

Permalink
Add formatting initializer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jverkoey committed Sep 19, 2024
1 parent 50bf8f5 commit 8d69e4f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ struct SelectableText: View {
self.string = string
}

init<F>(_ input: F.FormatInput, format: F) where F: FormatStyle, F.FormatInput: Equatable, F.FormatOutput == String {
self.string = format.format(input)
}

var body: some View {
#if !os(watchOS)
if #available(iOS 18, *) {
Expand Down

0 comments on commit 8d69e4f

Please sign in to comment.