Unified UIViewController “became frontmost” detection?

前端 未结 2 548
梦如初夏
梦如初夏 2020-12-08 14:48

In my mind, these situations are all parallel:

  • My view controller presented another view controller fullscreen, which has now been dismissed

2条回答
  •  醉梦人生
    2020-12-08 15:28

    One solution could be to take the Coordinator approach like in a MVVM-C style architecture. You never directly change view hierarchy in a VC but always call into the Coordinator to do it for you. coordinator.showDetails(...)

    Additionally you define a viewDidBecomeForemost method in your VCs that the coordinator can invoke when returning to a VC.

提交回复
热议问题