From 45aa41287f857d61f2150fd720ebd6ba884e4128 Mon Sep 17 00:00:00 2001 From: Eli Perkins Date: Thu, 30 Nov 2023 11:30:06 -0700 Subject: [PATCH] Safe-guard usage as well --- Sources/Runestone/TextView/Core/TextView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Runestone/TextView/Core/TextView.swift b/Sources/Runestone/TextView/Core/TextView.swift index b7d0b6fe7..e21500ed8 100644 --- a/Sources/Runestone/TextView/Core/TextView.swift +++ b/Sources/Runestone/TextView/Core/TextView.swift @@ -1234,10 +1234,12 @@ private extension TextView { isInputAccessoryViewEnabled = true textInputView.removeInteraction(nonEditableTextInteraction) textInputView.addInteraction(editableTextInteraction) + #if compiler(>=5.9) if #available(iOS 17, *) { // Workaround a bug where the caret does not appear until the user taps again on iOS 17 (FB12622609). textInputView.sbs_textSelectionDisplayInteraction?.isActivated = true } + #endif } } @@ -1390,10 +1392,12 @@ extension TextView: TextInputViewDelegate { if !view.viewHierarchyContainsCaret && self.editableTextInteraction.view != nil { view.removeInteraction(self.editableTextInteraction) view.addInteraction(self.editableTextInteraction) + #if compiler(>=5.9) if #available(iOS 17, *) { self.textInputView.sbs_textSelectionDisplayInteraction?.isActivated = true self.textInputView.sbs_textSelectionDisplayInteraction?.sbs_enableCursorBlinks() } + #endif } } }