Book Image

Swift 2 Design Patterns

By : Julien Lange
Book Image

Swift 2 Design Patterns

By: Julien Lange

Overview of this book

Table of Contents (15 chapters)
Swift 2 Design Patterns
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 7. Behavioral Patterns – Iterator, Mediator, and Observer

This chapter presents you with three other behavioral patterns, which support communication between objects. Objects keep their independence and sometimes their anonymity. The iterator pattern is often used with array, collection, and dictionary objects. The mediator allows communication between two objects without knowing each other's identities and the observer patterns mirror the publish/subscribe methodologies that are well known in distributed systems.

This chapter is divided in three sections:

  • The iterator pattern

  • The mediator pattern

  • The observer pattern