Type Safely

Type Safely

Use The New Type Placeholder Declaration With Underscores

Daily Coding Tip 120

Millie Sturgeon's avatar
Millie Sturgeon
Jun 29, 2022
∙ Paid
Image by sharkolot from Pixabay

There’s actually a way to specify a type you want Swift to infer.

When you initialise a new variable with "Hello world", it is not necessary to specify that it will be a string. Swift will infer that this is the type you want from the fact that you have initialised it with a string literal.

I have a simple enum with cases c…

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture