UIViewController+Expand.m 841 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // UIViewController+Expand.m
  3. // DDTG
  4. //
  5. // Created by 翟玉磊 on 16/5/6.
  6. // Copyright © 2016年 翟玉磊. All rights reserved.
  7. //
  8. #import "UIViewController+Expand.h"
  9. @implementation UIViewController (Expand)
  10. + (void)load {
  11. SEL originalSelector = @selector(viewDidLoad);
  12. SEL swizzledSelector = @selector(swizzled_viewDidLoad);
  13. [DDYHookUtility SwizzlingInClass:[self class] originalSelector:originalSelector swizzledSelector:swizzledSelector];
  14. }
  15. #pragma mark - Method Swizzling
  16. //设置背景
  17. - (void)swizzled_viewDidLoad {
  18. if (![self isKindOfClass:NSClassFromString(@"UIInputWindowController")] && ![NSStringFromClass([self class]) isEqualToString:@"UINavigationController"]) {
  19. // self.view.backgroundColor = APPBackgroundColor;
  20. }
  21. [self swizzled_viewDidLoad];
  22. }
  23. @end