Skip to content

Commit 78561d8

Browse files
Fixed warning about UITextView switching to TextKit 1 compatibility mode
1 parent a14440b commit 78561d8

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
### 🐞 Fixed
77
- Reaction overlay display in a modal chat view
8+
- Warning about UITextView switching to TextKit 1 compatibility mode
89

910
# [4.30.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.30.0)
1011
_March 30, 2023_

Sources/StreamChatSwiftUI/ChatChannel/Composer/ComposerTextInputView.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ struct ComposerTextInputView: UIViewRepresentable {
2020
var currentHeight: CGFloat
2121

2222
func makeUIView(context: Context) -> InputTextView {
23-
let inputTextView = InputTextView()
23+
let inputTextView: InputTextView
24+
if #available(iOS 16.0, *) {
25+
inputTextView = InputTextView(usingTextLayoutManager: false)
26+
} else {
27+
inputTextView = InputTextView()
28+
}
2429
context.coordinator.textView = inputTextView
2530
inputTextView.delegate = context.coordinator
2631
inputTextView.isEditable = editable

Sources/StreamChatSwiftUI/Utils/Common/InputTextView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ class InputTextView: UITextView, AccessibilityView {
8181
open func setUpAppearance() {
8282
backgroundColor = .clear
8383
textContainer.lineFragmentPadding = 8
84-
font = utils.composerConfig.inputFont
85-
textColor = colors.text
84+
font = InjectedValues[\.utils].composerConfig.inputFont
85+
textColor = InjectedValues[\.colors].text
8686
textAlignment = .natural
8787

8888
placeholderLabel.font = font
8989
placeholderLabel.textAlignment = .center
90-
placeholderLabel.textColor = colors.composerPlaceholderColor
90+
placeholderLabel.textColor = InjectedValues[\.colors].composerPlaceholderColor
9191
}
9292

9393
open func setUpLayout() {

0 commit comments

Comments
 (0)