如何调用presentViewController
调用present函数一般在ViewController里调用
UIViewController *vc = [[UIViewController alloc] init];
[self presentViewController:vc animated:YES completion:nil];
那么vc是加入了哪个内存呢
如果是NavigationController里的ViewController,是加入了NavigationController.viewControllers还是独立的一个Window?
// The view controller that was presented by this view controller or its nearest ancestor.
@property(nullable, nonatomic,readonly) UIViewController *presentedViewController NS_AVAILABLE_IOS(5_0);
// The view controller that presented this view controller (or its farthest ancestor.)
@property(nullable, nonatomic,readonly) UIViewController *presentingViewController NS_AVAILABLE_IOS(5_0);
由代码知道,其本身不在任何一个Array里,而是自身形成了一个链表.presentedViewController是指其present出来的VC,presentingViewController是指谁presented了当前VC.和VC当前VC本身是Tabbar还是Navigation还是普通VC没有关系.