Swiftpack.co -  ApplebaumIan/SwiftUI-Apple-Watch-Decimal-Pad as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
A dirty fix for Apple's missing decimal pad for watchOS
.package(url: "https://github.com/ApplebaumIan/SwiftUI-Apple-Watch-Decimal-Pad.git", from: "1.0.2")

SwiftUI Apple Watch Decimal Pad

With SwiftUI currently, Apple has not provided a decimal keypad for watchOS. Nor have they provided the ability to switch input types on a TextField() for watchOS. This is my kinda dirty fix.

Apple Watch 44mm

Demo of Keyboard 44mm Screen Size

Apple Watch 38mm

Demo of Keyboard 38mm Screen Size

Installation Instructions

WatchOS also has a weird issue with Swift Packages where you have to manually add the framework to the Watch Extension.

File > Swift Packages > add Package Dependecy... paste https://github.com/ApplebaumIan/SwiftUI-Apple-Watch-Decimal-Pad.git into the search bar. Once installed navigate to your Xcode Project and select the General tab. Select your watchOS Extension target and scroll to Frameworks, Libraries, and Embedded Content click the + button and add SwiftUI Apple Watch Decimal Pad framework.

You should now be able to add import SwiftUI_Apple_Watch_Decimal_Pad to the top of your desired Swift file.


import SwiftUI
import SwiftUI_Apple_Watch_Decimal_Pad
struct ContentView: View {
	@State public var presentingModal: Bool
	var body: some View {
		DigiTextView(placeholder: placeholder, 
			text: text,
			presentingModal: presentingModal

If you would like to set the alignment of the text withing the Textfield:

DigiTextView(placeholder: placeholder,
	text: text, 
	presentingModal: presentKeyboard,
+	alignment: .leading

If you would like to use the Decimil Pad version of the keyboard:

DigiTextView(placeholder: placeholder,
	text: text, 
	presentingModal: presentKeyboard,
	alignment: .leading,
+ 	style: .decimal


Stars: 2
Last commit: 10 hours ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

Version 1.0.2
10 hours ago

Swift Package Index thinks that this library works on non-watchOS systems. I have added a compiler flag to ensure this isn't the case.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics