Bez popisu

UIViewController+WMPageController.m 684B

1234567891011121314151617181920212223242526
  1. //
  2. // UIViewController+WMPageController.m
  3. // WMPageController
  4. //
  5. // Created by Mark on 15/6/11.
  6. // Copyright (c) 2015年 yq. All rights reserved.
  7. //
  8. #import "UIViewController+WMPageController.h"
  9. #import "WMPageController.h"
  10. @implementation UIViewController (WMPageController)
  11. - (WMPageController *)wm_pageController {
  12. UIViewController *parentViewController = self.parentViewController;
  13. while (parentViewController) {
  14. if ([parentViewController isKindOfClass:[WMPageController class]]) {
  15. return (WMPageController *)parentViewController;
  16. }
  17. parentViewController = parentViewController.parentViewController;
  18. }
  19. return nil;
  20. }
  21. @end