From 6304caaf889e6b8c5fc6372e9b7cebbc5e877e9f Mon Sep 17 00:00:00 2001 From: Jan de Vries Date: Wed, 23 Aug 2023 20:16:56 +0200 Subject: [PATCH 1/2] fixed minor warning in example app --- Example/Sources/View Controllers/ChatViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example/Sources/View Controllers/ChatViewController.swift b/Example/Sources/View Controllers/ChatViewController.swift index f42f903d..53af2d06 100644 --- a/Example/Sources/View Controllers/ChatViewController.swift +++ b/Example/Sources/View Controllers/ChatViewController.swift @@ -333,7 +333,7 @@ extension ChatViewController: InputBarAccessoryViewDelegate { let substring = attributedText.attributedSubstring(from: range) let context = substring.attribute(.autocompletedContext, at: 0, effectiveRange: nil) - print("Autocompleted: `", substring, "` with context: ", context ?? []) + print("Autocompleted: `", substring, "` with context: ", context ?? "-") } let components = inputBar.inputTextView.components From 7809a5b82cffb0167429c958a6caea5a65a48bb2 Mon Sep 17 00:00:00 2001 From: Jan de Vries Date: Wed, 23 Aug 2023 20:21:11 +0200 Subject: [PATCH 2/2] fixed IBAV position issue in the SwiftUI example by adding ignoresSafeArea modifier to the body (iOS 14+) --- .../Sources/Views/SwiftUI/SwiftUIExampleView.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Example/Sources/Views/SwiftUI/SwiftUIExampleView.swift b/Example/Sources/Views/SwiftUI/SwiftUIExampleView.swift index 12c69c02..b4fd02bc 100644 --- a/Example/Sources/Views/SwiftUI/SwiftUIExampleView.swift +++ b/Example/Sources/Views/SwiftUI/SwiftUIExampleView.swift @@ -23,9 +23,20 @@ struct SwiftUIExampleView: View { self.cleanupSocket() } .navigationBarTitle("SwiftUI Example", displayMode: .inline) + .modifier(IgnoresSafeArea()) //fixes issue with IBAV placement when keyboard appears } // MARK: Private + + private struct IgnoresSafeArea: ViewModifier { + func body(content: Content) -> some View { + if #available(iOS 14.0, *) { + content.ignoresSafeArea(.keyboard, edges: .bottom) + } else { + content + } + } + } private func connectToMessageSocket() { MockSocket.shared.connect(with: [SampleData.shared.nathan, SampleData.shared.wu]).onNewMessage { message in