iOS how to simple return back to previous presented/pushed view controller programmatically?

前端 未结 2 678
萌比男神i
萌比男神i 2021-02-05 14:42

How to return back to previous view controller programmatically? I found this answer, but there is an example that demonstrate how to go back if we have navigation stack:

<
2条回答
  •  孤独总比滥情好
    2021-02-05 15:29

    Best answer is this: _ = navigationController?.popViewController(animated: true)

    Taken from here: https://stackoverflow.com/a/28761084/2173368

提交回复
热议问题