Best Practices

Mixins over Inheritance – Crunchy Development

When coming from an Object-Oriented Programming language like ObjC, inheritance is often used to share code between multiple classes. But that solution is not always the best, and have some issues.

In today’s article, we’ll see how Swift’s Protocol Extensions and their usage as “Mixins” can change the deal.

via Mixins over Inheritance – Crunchy Development.

Check this amazing post out! Some really epic examples to show the power of Mixins (protocol extensions). ❤ it.

Standard
Resources

Mixins and Traits in Swift 2 (Using Protocol Extensions)

This is a really great blog post by Matthijs Hollemans (author of the iOS Apprentice book I just finished reading) about the power of implementing protocol extensions/mixins/traits in your code to help reduce code-reuse, and make it more flexible.

It is a different way of thinking, but in my opinion, a much better way to code. I’m excited to implement protocol extensions into my app!

http://matthijshollemans.com/2015/07/22/mixins-and-traits-in-swift-2/

Standard