Use The 'some' Keyword For Any Function Parameter That Conforms To a Protocol
Daily Coding Tip 119

Here’s a simple protocol that requires a type to have a string property called spelled
. This means I want a numeric type that conforms to this to be able to spell out the word name for that number, for instance ‘one’ or ‘two’. Luckily there’s a fairly easy way to conform to this protocol by using a NumberFormatter
, whi…
Keep reading with a 7-day free trial
Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.