{"id":21493550,"url":"https://github.com/alienkevin/sample_imkit_no_such_module","last_synced_at":"2025-10-12T07:44:26.965Z","repository":{"id":97740292,"uuid":"558529812","full_name":"AlienKevin/sample_imkit_no_such_module","owner":"AlienKevin","description":"A sample IM Kit project to reproduce a no such module error","archived":false,"fork":false,"pushed_at":"2022-10-27T18:28:07.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T11:50:45.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlienKevin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-27T18:26:02.000Z","updated_at":"2022-10-27T18:28:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"9794a6c7-131b-49d1-83f7-8515dfaf59fc","html_url":"https://github.com/AlienKevin/sample_imkit_no_such_module","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlienKevin/sample_imkit_no_such_module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienKevin%2Fsample_imkit_no_such_module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienKevin%2Fsample_imkit_no_such_module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienKevin%2Fsample_imkit_no_such_module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienKevin%2Fsample_imkit_no_such_module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlienKevin","download_url":"https://codeload.github.com/AlienKevin/sample_imkit_no_such_module/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienKevin%2Fsample_imkit_no_such_module/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010672,"owners_count":26084785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T15:43:24.129Z","updated_at":"2025-10-12T07:44:26.959Z","avatar_url":"https://github.com/AlienKevin.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this?\n\nThis is a sample implementation of IMKit App with Swift/SwiftUI.\n\n## Working Environment\n\nCheck in July 2022.\n* macOS 12.4\n* Swift 5.6\n* Xcode 13.4.1\n\nCheck in 2021.\n* macOS 11.5\n* Swift 5.5\n* Xcode13 (beta)\n\n## Usage\nTo try this sample project, use following steps.\n\n* Open this project in Xcode.\n* Do `sudo chmod -R 777 /Library/Input\\ Methods` on terminal.\n* Run the project.\n* Add 'IMKitSample' in **setting** \u003e **keyboard** \u003e **input source** \u003e **English**.\n* Choose IMKitSample as input source and try it on some text field.\n\n## Procedure to make project\nI used following steps to prepare this sample project.\n\n* Create new project. Bundle Identifier must contain `.inputmethod.` part in the String.\n\n* Run.\n\n* Remove `IMKitSampleApp.swift`, `ContentView.swift`\n\n* Add Swift files `AppDelegate.swift` and `IMKitSampleInputController.swift`.\n\n  ```swift\n  // AppDelegate.swift\n  import Cocoa\n  import InputMethodKit\n  \n  // necessary to launch this app\n  class NSManualApplication: NSApplication {\n      private let appDelegate = AppDelegate()\n  \n      override init() {\n          super.init()\n          self.delegate = appDelegate\n      }\n  \n      required init?(coder: NSCoder) {\n          fatalError(\"init(coder:) has not been implemented\")\n      }\n  }\n  \n  @main\n  class AppDelegate: NSObject, NSApplicationDelegate {\n      var server = IMKServer()\n      var candidatesWindow = IMKCandidates()\n  \n      func applicationDidFinishLaunching(_ notification: Notification) {\n          // Insert code here to initialize your application\n          server = IMKServer(name: Bundle.main.infoDictionary?[\"InputMethodConnectionName\"] as? String, bundleIdentifier: Bundle.main.bundleIdentifier)\n          candidatesWindow = IMKCandidates(server: server, panelType: kIMKSingleRowSteppingCandidatePanel, styleType: kIMKMain)\n          NSLog(\"tried connection\")\n      }\n  \n      func applicationWillTerminate(_ notification: Notification) {\n          // Insert code here to tear down your application\n      }\n  }\n  ```\n\n  ```swift\n  // IMKitSampleInputController.swift\n  import Cocoa\n  import InputMethodKit\n  \n  @objc(IMKitSampleInputController)\n  class IMKitSampleInputController: IMKInputController {\n      override func inputText(_ string: String!, client sender: Any!) -\u003e Bool {\n          NSLog(string)\n          // get client to insert\n          guard let client = sender as? IMKTextInput else {\n              return false\n          }\n          client.insertText(string+string, replacementRange: NSRange(location: NSNotFound, length: NSNotFound))\n          return true\n      }\n  }\n  ```\n\n* Add icon file `main.tiff`.\n\n* Modify Info.plist\n\n  ```\n  key: NSPrincipalClass  type: _  value: $(PRODUCT_MODULE_NAME).NSManualApplication\n  key: InputMethodConnectionName  type: String  value: $(PRODUCT_BUNDLE_IDENTIFIER)_Connection\n  key: InputMethodServerControllerClass  type: String  value: $(PRODUCT_MODULE_NAME).IMKitSampleInputController\n  key: Application is background only  type: Boolean  value: YES\n  key: tsInputMethodCharacterRepertoireKey  type: Array  value: [item0: String = Latn]\n  key: tsInputMethodIconFileKey  type: String  value: main.tiff\n  ```\n\n* Add entitlements\n\n  * Go **Signing \u0026 Capabilities** → **+Capability** → **App Sandbox**\n\n  * Go IMKitSample.entitlements, add \n\n    ```\n    key: com.apple.security.temporary-exception.mach-register.global-name\n    type: String\n    value: $(PRODUCT_BUNDLE_IDENTIFIER)_Connection\n    ```\n\n* Do `sudo chmod -R 777 /Library/Input\\ Methods` on terminal.\n\n* Modify build settings.\n  * Go **Build Locations** → **Build Products Path** of debug → value `/Library/Input Methods`\n  * Go **+** → **Add User-Defined Setting** → Set key `CONFIGURATION_BUILD_DIR`, value `/Library/Input Methods`.\n  * !!! DO NOT edit thinklessly, this setting is really fragile.\n\n* Try Run.\n\n## Trouble Shooting\n\n*I'm not an expert of macOS. Please don't ask too much, I don't know either.*\n\n* InputMethods says **connection \\*\\*Failed\\*\\*** all though there are no diff!\n  * Open 'Activity Monitor' app, search the name of your InputMethods, and kill the process. Then try again.\n\n* `print()` doesn't work!\n  * Use `NSLog()`.\n\n* App doesn't run!\n  * Check the path of build product file. If it isn't at `/Library/Input Methods/...`, something went wrong.\n  * Maybe build setting went wrong. Check the settings. Especially, if `CONFIGURATION_BUILD_DIR=\"\";` found, remove the line.\n* Where's my InputMethod!?!?\n  * Check English section. You would found it.\n\n## Reference\n\nThanks to authors!!\n\n* https://mzp.hatenablog.com/entry/2017/09/17/220320\n* https://www.logcg.com/en/archives/2078.html\n* https://stackoverflow.com/questions/27813151/how-to-develop-a-simple-input-method-for-mac-os-x-in-swift\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falienkevin%2Fsample_imkit_no_such_module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falienkevin%2Fsample_imkit_no_such_module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falienkevin%2Fsample_imkit_no_such_module/lists"}