Operator overloading and custom operators are a great way to make your Swift code more readable. Here are a couple of nice tutorials that explore operator overloading, and creating custom operators in-depth from Nick Hanan.
In the first tutorial Nick does a nice job of explaining operator overloading, and why you’d like to do and shows how to set up a custom minus operator working with dates, and how to overload the == operator to compare two objects of the same type.
In the second tutorial Nick explains how to create completely custom operators, and creates a custom postfix percentage operator, and a custom infix power operator.
Some nice tutorials for those unfamiliar with operator overloading.
You may also be interested in: Euler – A Swift library providing over 40 custom math operators.
Submit A Resource
Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?
You can submit the url here.
The resources we feel will appeal to our readers the most will be posted on the front page.