What? changing the functionality of a method at runtime.
When to use? for the codes that you don’t own but you want to modify its functionality, such as adding logging. (for the codes you have control over, just use extension.)
How? see Method swizzling in iOS swift
Month: October 2018
keypath
What? allow referring to properties without actually invoking them.
Why do you need it? If you want to create an adapter for a property.
If keypath is used together with generics and associated type, the adapter can fit various types as well. Making it even more powerful and cleaner code.
See detail in this nice article.