Tuesday, May 6, 2014

Aspects

Aspects:

Delightful, simple library for aspect oriented programming by @steipete.

Think of Aspects as method swizzling on steroids. It allows you to add code to existing methods per class or per instance, whilst thinking of the insertion point e.g. before/instead/after. Aspects automatically deals with calling super and is easier to use than regular method swizzling.

[…]

An important limitation is that for class-based hooking, a method can only be hooked once within the subclass hierarchy.

[…]

KVO works if observers are created after your calls aspect_hookSelector: It most likely will crash the other way around.

1 Comment

Wow, I remember being very intrigued by AspectCocoa 10 years ago (http://cocoadev.com/AspectCocoa), it's fun to see the concepts finally used in actual real apps.

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment