A tip for optimising speed for your Swift and Objective-C code — Creating a new collection type occupies resources. Frequently creating collection type objects, for example, initialising a dictionary in a for-loop or in a function that is frequently executed, might consume a considerable amount of time. In the following examples, I use reduce(_:_:) and reduce(into:_:) to demonstrate the differences in execution…