Skip to content

Commit

Permalink
Safe-guard usage as well
Browse files Browse the repository at this point in the history
  • Loading branch information
eliperkins committed Nov 30, 2023
1 parent 55e4c76 commit 45aa412
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Runestone/TextView/Core/TextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit 45aa412

Please sign in to comment.