Group Group Group Group Group Group Group Group Group

raywenderlich.com Forums

iOS Design Patterns

Learn about common iOS design patterns like singletons, delegates, and notifications and how to use them in your own applications.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/2655-ios-design-patterns

Hi @ganem,
While having a discussion on decorator pattern on stackoverflow.com, i answered that

Decorator pattern can be achieved with either of these Category and Delegation pattern.
which i learned from your tutorial and successfully implemented within my project.

But got comments that its wrong and Category and Delegation has nothing do with decorator pattern followed by below comment

Take a look at proxying and message forwarding. That’s the real way to do this in Objective-C

Can you share some strong reference supporting your answer ?

Please follow discussion link Design pattern in iOS as decorator pattern and add some comment if possible.

Thanks
Pawan

I read the comments in the stackoverflow post and the commenter is simply wrong.
Category and delegation are not different names for the decorator pattern, but rather a way of using the decorator pattern in your iOS app.
I added a short comment in the thread.

This is such a good resource for Design Pattern but i would like to request for swift version since i only know swift. Hope it’s updated for swift in future. Thanks.

I didn’t understand the Adapter example. How is the horizontal scroller connected to this? and which are the incompatible classes that the Adapter allows to work together? Please explain more. Thanks

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]