diff --git a/Sources/SwiftTerm/iOS/iOSTextInput.swift b/Sources/SwiftTerm/iOS/iOSTextInput.swift index 9d632427..e4173ebd 100644 --- a/Sources/SwiftTerm/iOS/iOSTextInput.swift +++ b/Sources/SwiftTerm/iOS/iOSTextInput.swift @@ -60,7 +60,7 @@ extension TerminalView: UITextInput { } public func text(in range: UITextRange) -> String? { - let r = range as! xTextRange + guard let r = range as? xTextRange else { return "" } if textInputStorage.count >= max (r._start, r._end) { let res = String (textInputStorage [r._start..