diff --git a/Source/Modules/ControllerModules/KeyHandler_States.swift b/Source/Modules/ControllerModules/KeyHandler_States.swift index 13e49af1..b84fad5a 100644 --- a/Source/Modules/ControllerModules/KeyHandler_States.swift +++ b/Source/Modules/ControllerModules/KeyHandler_States.swift @@ -116,7 +116,7 @@ extension KeyHandler { var cleanedComposition = "" for theChar in composedText { if let charCode = theChar.utf16.first { - if !(theChar.isASCII && !(charCode.isPrintable())) { + if !(theChar.isASCII && !(charCode.isPrintable)) { cleanedComposition += String(theChar) } } diff --git a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift index b35ea3c1..017a4320 100644 --- a/Source/Modules/ControllerModules/ctlInputMethod_Core.swift +++ b/Source/Modules/ControllerModules/ctlInputMethod_Core.swift @@ -210,7 +210,7 @@ class ctlInputMethod: IMKInputController { // 無法列印的訊號輸入,一概不作處理。 // 這個過程不能放在 KeyHandler 內,否則不會起作用。 - if !input.charCode.isPrintable() { + if !input.charCode.isPrintable { return false } diff --git a/Source/Modules/IMEModules/IME.swift b/Source/Modules/IMEModules/IME.swift index 7ae55cd5..e79a040d 100644 --- a/Source/Modules/IMEModules/IME.swift +++ b/Source/Modules/IMEModules/IME.swift @@ -413,7 +413,7 @@ extension String { // Ref: https://forums.swift.org/t/57085/5 extension UniChar { - public func isPrintable() -> Bool { + public var isPrintable: Bool { guard Unicode.Scalar(UInt32(self)) != nil else { struct NotAWholeScalar: Error {} return false