原理:苹果iOS之Method Swizzling危险吗?

What are the Dangers of Method Swizzling in Objective C?

分析
Here are some of the pitfalls of method swizzling:

  • Method swizzling is not atomic
  • Changes behavior of un-owned code
  • Possible naming conflicts
  • Swizzling changes the method’s arguments
  • The order of swizzles matters
  • Difficult to understand (looks recursive)
  • Difficult to debug