Build a Custom Sliding Keyboard in SwiftUI

Join me on a journey to build a custom keyboard

Mark Lucking
Geek Culture

--

Photo by Aryan Dhiman on Unsplash

I want to build a game that needs a keyboard. But I don’t want to use an iOS keyboard. I know there is a whole accessibility library that I can call on, but I want to do something that is a little more visually appealing. I want something that a user with fat fingers or limited sight can use. And I don’t want a keyboard that will consume half the screen either. Join me on a journey to get creative and come up with some custom keyboards.

Version I

Here is a solution that works, but is too simple. I can recall a time when mobile phones had these sort of interfaces, but with no backspace, move ahead only and a long press to select the letter — even spelling the work “cat” can be a bit of bind. The dual gestures are not ideal either in honesty; I can imagine someone struggling to press it long enough or simply too long.

Version II

Used some SF Font characters to add some arrows to the setup, so that you can move forward and backward in the alphabet and took the opportunity to use the click on the letter to select it…

--

--

Mark Lucking
Geek Culture

Coding for 35+ years, enjoying using and learning Swift/iOS development. Writer @ Better Programming, @The StartUp, @Mac O’Clock, Level Up Coding & More