Where to remove observer for NSNotification in Swift?

后端 未结 9 1478
你的背包
你的背包 2020-12-01 00:37

Where should I remove the observer for NSNotification in Swift, since viewDidUnload and dealloc() are unavailable?

9条回答
  •  时光说笑
    2020-12-01 00:58

    It is also good if you add your observer in viewWillAppear() and remove them in viewWillDisappear()

提交回复
热议问题