0
///Here is my Function for Button press
@IBAction func keyPressed(_ button: UIButton) {
var buttonTap = button.titleLabel!.text
///Here i call a variable for Get before input in textDocumentProxy
var jukto = textDocumentProxy.documentContextBeforeInput
/// Now i want check if Three digits of documentContextBeforeInput is "ABC" Than it should change to "DE"
if jukto == "ABC" {
buttonTap = "DE"
}
(textDocumentProxy as UIKeyInput).insertText("\(buttonTap!)")
}
/// Hinweis: Es wird viele Zeichen in meinem documentContext geben, aber ich möchte überprüfen, ob "ABC" diese 3 Ziffern zusammen ist, als es geändert wird.Zeichen in documentContextBeforeInput in Benutzerdefinierter Tastatur
Das funktioniert für mich. Vielen Dank :) –