An open-source repo of design pattern implementations in Swift programming language.
All examples are located HERE. Check out the table below for convenience.
๐ฎ๐ผ Behavioural | ๐ท๐ผ Creational ย ย ย | ๐จ๐ผโ๐ญ Structural ย | ๐จ๐ผโ๐ Non-GOF | ๐จ๐ปโ๐ฌ Functional |
---|---|---|---|---|
Chain of Responsibility | Factory Method | Facade | Dependency Injection | Functor |
Strategy | Abstract Factory | Decorator | Object Pool | Applicative |
Command | Singleton | Proxy | Caching | Monad |
State | Builder | Adapter | Private Class Data | Callback |
Observer | Prototype | Flyweight | Delegate | Factory Kit |
Memento | Bridge | Multicast Delegate | Future & Promise | |
Iterator | Composite | DataSource | ||
Template Method | Lazy Loading | |||
Mediator | Throttling | |||
Interpreter | ||||
Visitor |
Each pattern is overviewed in a separate Markdown file which contains description, structure, UML, advantages/disadvantages etc. Click on a pattern title to see more.
๐ฎ๐ผ Behavioural
Design patterns that identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.
Chain of Responsibility
Strategy
Command
State
Observer
Iterator
Memento
Template Method
Mediator
Interpreter
Visitor
๐ท๐ผ Creational
Design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation.
Factory Method
Abstract Factory
Singleton
Builder
Prototype
Class Cluster
๐จ๐ผโ๐ญ Structural
Design patterns that ease the design by identifying a simple way to realize relationships between entities.
Facade
Decorator
Proxy
Adapter
Flyweight
Bridge
Composite
๐จ๐ผโ๐ Non-GOF
Design patterns that are not described in the GOF book.
Dependency Injection
Object Pool
Private Class Data
Delegate
Multicast Delegate
DataSource
Lazy Loading
Throttling
๐จ๐ปโ๐ฌ Functional
Design patterns that come from functional programming.
Monad
Future & Promise
Factory Kit
Callback
Functor
Applicative Functor