In an earlier recipe, we looked at some of the advanced operators that Swift offers on top of the common mathematical operators. In this recipe, we will look at how we can create our own operators, enabling very concisely expressed behaviors that feel like part of the language.
Create custom operators
Getting ready
The custom operator we will create will be used to append the information in one value to the information in another value, producing a new value that contains the second value, followed by the first. The functionality we are looking to achieve is similar to the >> Unix command.