变量+ insertText Swift deleteBackward()+ insertText(“。”)

时间:2015-01-11 07:07:22

标签: xcode swift keyboard

我正在制作自定义键盘。我想要一个自动周期功能但我的代码有错误。请帮我解决它

代码:

@IBAction func autoPeriod(button: UIButton) {
    (textDocumentProxy as UIKeyInput).deleteBackward() + insertText(". ")
}

干杯,

Palash

1 个答案:

答案 0 :(得分:0)

我明白了:

<强>代码:

@IBAction func autoPeriod(button: UIButton) {
    (textDocumentProxy as UIKeyInput).deleteBackward()
    (textDocumentProxy as UIKeyInput).insertText(".")
}