Skip to content

Commit 4c83689

Browse files
committed
Поправил фон текствью
1 parent d8a7231 commit 4c83689

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

SwiftUI-WorkoutApp/DesignSystem/Sources/DesignSystem/SWTextEditor.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff 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
5366
struct SWTextEditor_Previews: PreviewProvider {
5467
static var previews: some View {

0 commit comments

Comments
 (0)