How to dismiss a view controller opened with presentModalViewController:

前端 未结 3 672
迷失自我
迷失自我 2021-02-05 10:25

I presented a view controller using presentModalViewController:, now how to close/dismiss it?

3条回答
  •  有刺的猬
    2021-02-05 11:03

    You have two choices, both involves using dismissModalViewController.

    The preferred way is to use delegation and tell the view controller who was responsible for presenting the view to dismiss it. The other way is to have the view who was presented to dismiss itself (which actually asks the parent to dismiss it.)

提交回复
热议问题