ふと、カスタムキーボードが作成したいと思ったのでカスタムキーボード作成の第一歩に踏み出してみることにしました。 カスタムXibでキーボードのViewを作成する記事はあったのですが、SwiftUIでViewを作成しているものはあまりなかったので記事にしてみることにしました。 環境 Xcode 14.1 iOS 16.1 準備 まずはXcodeで新規プロジェクトを立ち上げます。 最初はAppのテンプレートを選択します。 オプション設定では任意のプロジェクト名を設定し、Interfaceは、SwiftUIとStorybaordのどちらでも問題ありません。 プロジェクトが作成できたら、次はプロジェクト > TARGET の下部分にある+ボタンからカスタムキーボード用のエクステンションを追加します。 +ボタンを押すと、ターゲット追加用のポップアップが表示されます。Custom Keybaord Ex