The startling uniquing of Swift 4 dictionaries

Another great post from Erica Sadun. Here Erica shows us how we can use the new uniquing feature which has been added to the Dictionary type in Swift 4. This feature allows us to create a Dictionary of unique keys, while applying a function to each key's value each time a duplicate key is added. In one example, Erica uses this to find out which word appears the most in a large String.