'How to load customized keylayout files in Xcode?

I created several keylayout files using Ukelele, plus making them into a bundle to make sure each keylayout has its identifiers like org.atelierInmu.vChewing.keyLayouts.zhuyindachen.

Then I am trying to use this in my input method project. However, it looks far from enough even if I manually set the following:

// Preferences.basisKeyboardLayout reads the identifier above from the app preferences list file.

let basisKeyboardLayoutID = Preferences.basisKeyboardLayout
(client as? IMKTextInput)?.overrideKeyboard(withKeyboardNamed: basisKeyboardLayoutID)

Any instructions regarding what I should do to let it work?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source