File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ public struct SWTextEditor: View {
2525 }
2626
2727 public var body : some View {
28- TextEditor ( text: $text)
29- . accentColor ( . swAccent)
28+ textEditorView
3029 . frame ( height: height)
3130 . padding ( . horizontal, 8 )
3231 . overlay (
@@ -49,6 +48,20 @@ public struct SWTextEditor: View {
4948 }
5049}
5150
51+ private extension SWTextEditor {
52+ @ViewBuilder
53+ var textEditorView : some View {
54+ if #available( iOS 16 . 0 , * ) {
55+ TextEditor ( text: $text)
56+ . tint ( . swAccent)
57+ . scrollContentBackground ( . hidden)
58+ } else {
59+ TextEditor ( text: $text)
60+ . accentColor ( . swAccent)
61+ }
62+ }
63+ }
64+
5265#if DEBUG
5366struct SWTextEditor_Previews : PreviewProvider {
5467 static var previews : some View {
You can’t perform that action at this time.
0 commit comments