Christian Tietze

  • Posts
  • Books
  • Apps
  • Work With Me
  • Contact

Using Blocks to Realize the Strategy Pattern

Jul 10th, 2015

There’s this saying that the Strategy pattern can be realized in Swift using blocks. Without blocks, a Strategy object implements usually one required method of an interface (or protocol) to encapsulate a variation of behavior. This behavior can be switched at runtime. It’s like a plug-in.

Continue reading …

  • ∞ Permalink
  • • Comments
  • • Tags:
    • block
    • swift
    • design-pattern

Contact • Newsletter • blog post feed
Become an affiliate • Legal Information • Twitter

Except where otherwise noted, content on this site is licensed CC BY-SA 4.0.