search

Home  >  Q&A  >  body text

ios - 在super class category的+load()方法里使用method swizzling 可以影响到它的子类

利用method swizzling 来log用户行为路径

↑↑↑ 这篇文章在UIViewController的category里replacement ViewDidAppear方法,可以影响到子类的ViewDidAppear方法。

我不明白XXViewController调用viewDidAppear的方法的时候怎么就可以到调用到UIViewController里面的swizzling_viewDidAppear方法呢。

那黑魔法替换的不是UIViewController自己的2个IMP吗?怎么就可以影响到子类了呢?

大家讲道理大家讲道理2893 days ago572

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 09:17:58

    Because of the - (void)viewDidAppear:(BOOL)animated 里面调用了 [super viewDidAppear:animated];method

    of the XXViewController class

    reply
    0
  • Cancelreply