Skip to content

Commit 48c1659

Browse files
committed
如果沒有匯入pinyin.json而輸入';時提示使用者 #6
1 parent 0df4121 commit 48c1659

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ilimi/Utils/ZhuyinMode/ZhuyinMode.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ extension IlimiInputController {
1313

1414
// 輸入';進入注音模式
1515
func checkIsZhuyinMode(_ input: String) -> Bool {
16+
let hadReadPinyin = UserDefaults.standard.object(forKey: "hadReadPinyinJson") as? Bool ?? false
17+
if (!hadReadPinyin) {
18+
// 沒有注音檔的話提示使用者
19+
NotifierController.notify(message: "請下載並匯入注音檔", stay: true)
20+
return false
21+
}
1622
isZhuyinMode = (input == "';")
1723
if isZhuyinMode {
1824
InputContext.shared.cleanUp()

0 commit comments

Comments
 (0)