Christian Tietze

  • Blog Posts
  • Writing
  • 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 Feed • /feeds • /now • /uses • @ctietze@mastodon.social • Privacy & Legal Information

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

As an Amazon Associate I earn from qualifying purchases. This e.g. applies to links to Amazon.com.