UIViewController+ChildViewController.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // UIViewController+ChildViewController.h
  3. // CommonLibrary
  4. //
  5. // Created by Alexi on 14-2-24.
  6. // Copyright (c) 2014年 CommonLibrary. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. // 还需要调试这一块的代码
  10. @interface UIViewController (ChildViewController)
  11. - (void)addChild:(UIViewController *)vc;
  12. - (void)addChild:(UIViewController *)vc animation:(void (^)(void))inAnimation;
  13. - (void)addChild:(UIViewController *)vc inRect:(CGRect)rect;
  14. - (void)addChild:(UIViewController *)vc inRect:(CGRect)rect animation:(void (^)(void))inAnimation;
  15. - (void)addChild:(UIViewController *)vc container:(UIView *)view;
  16. - (void)addChild:(UIViewController *)vc container:(UIView *)view inRect:(CGRect)rect;
  17. - (void)addChild:(UIViewController *)vc container:(UIView *)view inRect:(CGRect)rect animation:(void (^)(void))inAnimation;
  18. - (void)removeChild:(UIViewController *)vc;
  19. - (void)removeChild:(UIViewController *)vc animation:(void (^)(void))outAnimation;
  20. - (void)removeChild:(UIViewController *)vc inContainer:(UIView *)view;
  21. - (void)removeChild:(UIViewController *)vc inContainer:(UIView *)view animation:(void (^)(void))outAnimation;
  22. // 默认是在self.view中操作
  23. - (void)replace:(UIViewController *)oldVC withNew:(UIViewController *)newVC animations:(void (^)(void))animations;
  24. // 在container中进行操作
  25. - (void)replace:(UIViewController *)oldVC withNew:(UIViewController *)newVC container:(UIView *)container animations:(void (^)(void))animations;
  26. @end