Issue with calling viewWillAppear of presenting view controller when presented one is dismissed

前端 未结 2 714
别跟我提以往
别跟我提以往 2021-01-07 04:25

I currently have a base view controller say AVC which present another view controller say BVC over current context like this:

let bvc: BVC = sb.instantiateVi         


        
2条回答
  •  礼貌的吻别
    2021-01-07 05:10

    Issue Explanation

    As u noticed that when presenting OverCurrentContext, viewWillAppear will not be called on dismiss.

    Why ?

    viewWillAppear will be called whenever u back to your view (in case that the view is already disappeared). When u present a new view using OverCurrentContext, the main view is still appeared and u present a new one over it or over part of it ! Popup effect !

    Because of this logic, viewWillAppear will not be called when u dismiss the OverCurrentContext view and u have to handle it manually using any way like @Sandeep did above.

提交回复
热议问题