2018-04-11 iOS load initialize +load()和+initialize()总结 load调用在main()之前 可在load中对该类一些方法进行替换 1234567+ (void)load{ // Inject "-pushViewController:animated:" Method originalMethod = class_getInstanceMethod(self, @selector(pushViewController:animated:)); Method swizzledMethod = class_getInstanceMethod(self, @selector(fd_pushViewController:animated:)); method_exchangeImplementations(originalMethod, swizzledMethod);} 前一篇 image memory manage 后一篇 UIViewController Lifecycle