Skip to content

Instantly share code, notes, and snippets.

@dlo
Last active February 19, 2016 16:43
Show Gist options
  • Save dlo/86208878ff976261fa16 to your computer and use it in GitHub Desktop.
Save dlo/86208878ff976261fa16 to your computer and use it in GitHub Desktop.

All Lionheart Swift and Objective-C libraries are built with a "no magic" philosophy. This means absolutely no usage of:

  • Method swizzling.
  • Custom operators.
  • Associated Objects (objc_setAssociatedObject / objc_getAssociatedObject).
  • respondsToSelector(_:)

Our Swift libraries are all protocol-oriented. For more information on what this means, watch WWDC 2015, Session 408. Additionally, our Swift libraries:

  • Always unwrap optionals safely, and never define implicitly unwrapped optionals.
  • Never assume type-safety at runtime.

While these restrictions usually entail additional code, I believe that the tradeoff is not only worth it, but better mirrors the philosophy of Swift itself. You can use any of our libraries rest assurred that any issues you'll see are found at compile-time, not runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment