From 14a50f39abe0fafa4579e334dc5681409d522619 Mon Sep 17 00:00:00 2001 From: cleexiang Date: Mon, 27 Apr 2020 23:06:57 +0800 Subject: [PATCH] Fixed bug when characters is more than one Signed-off-by: cleexiang --- SwiftyCodeView/Classes/SwiftyCodeView/SwiftyCodeView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SwiftyCodeView/Classes/SwiftyCodeView/SwiftyCodeView.swift b/SwiftyCodeView/Classes/SwiftyCodeView/SwiftyCodeView.swift index d7f0703..49f7ee4 100644 --- a/SwiftyCodeView/Classes/SwiftyCodeView/SwiftyCodeView.swift +++ b/SwiftyCodeView/Classes/SwiftyCodeView/SwiftyCodeView.swift @@ -111,6 +111,10 @@ extension SwiftyCodeView: UITextFieldDelegate, SwiftyCodeTextFieldDelegate { return true } + if string.count > 1 { + return true + } + if !textField.hasText { let index = textField.tag let item = stackView.arrangedSubviews[index] as! SwiftyCodeItemView