Skip to content

说说presentingViewController和presentedViewController的区 #150

@tbfungeek

Description

@tbfungeek
  • presentingViewController[负责呈现的ViewController]
    如果我们沿着viewController堆栈,但凡有一个是通过 presentViewController:animated:completion: 方法推出的,那么presentingViewController 的值就是推出的堆栈的起点viewController.也就是说只有在调用presentViewController:animated:completion: 的时候才会更改这个值,如果通过push的话,就会继承操作的发起者的presentingViewController值。

  • presentedViewController[被呈现的ViewController]
    也就是你通过present模态推出了谁,你的presentedViewController就是谁.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions