Christian Tietze

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

Translate Optional Delegate Protocol Methods to Swift Block-based Event Handlers Using Nested Objects

Mar 21st, 2016

Found this little gem in a library called NextGrowingTextView, shortened to make the point clear with less code. It’s a collection of block-based event handlers in a little class:

Continue reading …

  • ∞ Permalink
  • • Comments
  • • Tags:
    • closure
    • locality

Block-Based API vs. Delegates – a Comparison

Jan 29th, 2016

As I’m exploring the use of block based API, which means to assign closures or functions handles to properties or pass them around as parameters to other functions, I found a few benefits and drawbacks in comparison to protocol-based object interactions. Here’s a breakdown of criteria for blocks and delegates.

Continue reading …

  • ∞ Permalink
  • • Comments
  • • Tags:
    • closure
    • protocol
    • testing
    • locality
    • memory-management
    • intent

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.