How to dictate a Swift function with argument labels
A Swift signature needs “thin arrow” for the return type and a casing command for each name. VoiceGem turns “func camel case fetch profile open paren for id colon pascal case uuid close paren async thin arrow pascal case profile” into a working declaration, with one caveat about acronyms.
A seventeen-word async Swift signature is about 20 seconds of typing against about 6.2 seconds of speech. (sources: Dhakal, Feit, Kristensson & Oulasvirta, “Observations on Typing from 136 Million Keystrokes”, CHI 2018, 168,000 participants, 136 million keystrokes; Yuan, Liberman & Cieri, “Towards an Integrated Understanding of Speaking Rate in Conversation”, Interspeech 2006, 2,438 American English telephone conversations (Switchboard corpus). The speech figure is conversational rate, not a measured dictation rate — no such measurement exists.)
func fetchProfile(for id: Uuid) async -> ProfileThis tool runs entirely in your browser. Nothing you type is sent anywhere, stored, or logged.
Step by step
- 1
Say “func” then a casing command
Speak “func camel case fetch profile”. The keyword passes through and the casing command builds the method name from the words that follow.
- 2
Speak the argument label and the parameter name
Say “for id colon” and the type. Swift's external and internal names are two plain words, and neither is in VoiceGem's table, so both pass through.
- 3
Say “thin arrow” for the return type
Use the qualified phrase. The bare word “arrow” produces the fat arrow, which in Swift is a parse error rather than a subtle bug.
- 4
Fix acronym capitalisation afterwards
Correct names like UUID by hand. A pascal casing command capitalises the first letter of each spoken word, so “pascal case uuid” returns Uuid.
Swift acronyms are where the pascal casing command needs a manual fix
Swift's standard library is full of initialisms — UUID, URL, JSON, API — and the pascal casing command capitalises only the first letter of each spoken word. Saying “pascal case uuid” returns Uuid, which does not compile against Foundation's type.
The workaround is to say the type name as a single word and correct the case, or to type the short type names and dictate the rest of the signature. VoiceGem holds no acronym dictionary on purpose: a dictionary would make capitalisation depend on which initialisms someone had registered, which is exactly the variability the Deterministic Pass exists to remove.
Where the manual path breaks
Xcode's autocomplete is strong and a short Swift signature is fast to type with it. Dictation does not replace autocomplete and works alongside it.
Long signatures with argument labels are the case that suits speaking. Swift's convention of separate external and internal parameter names means a three-parameter function carries six identifiers, and dictating them in VoiceGem is six spoken words rather than six typed names. The acronym fix, when needed, is one edit at the end.
Doing this somewhere else? the same speech-to-code converter this demo runs, dictating Swift documentation comments, the same thing for dictating Bash functions, or the same thing for dictating Go functions.
Common questions
VoiceGem's casing command capitalises the first letter of each spoken word and holds no acronym dictionary. Correct initialisms by hand after dictating.
You get the fat arrow, which is a parse error in a Swift signature. Say “thin arrow” or “dash arrow” for the return type.
Yes. Say “at sign pascal case published” then the declaration. The at sign binds rightward onto the wrapper name with no space.
Dictate a Swift signature with argument labels and check the return arrow.
Open the tool