// The view controller that was presented by this view controller or its nearest ancestor. @property(nullable, nonatomic,readonly) UIViewController *presentedViewController API_AVAILABLE(ios(5.0)); // The view controller that presented this view controller (or its farthest ancestor.) @property(nullable, nonatomic,readonly) UIViewController *presentingViewController API_AVAILABLE(ios(5.0));
---------------------A弹B后--------------------- A.presentingViewController (null) A.presentedViewController B B.presentingViewController A B.presentedViewController (null) ---------------------B弹C后--------------------- A.presentingViewController (null) A.presentedViewController B B.presentingViewController A B.presentedViewController C C.presentingViewController B C.presentedViewController (null)