فهرست منبع

observer 'self' shall be removed in deinit only (NotificationCenter.default.removeObserver triggers a warning where nc.removeObserver does not)

B. Petersen 4 سال پیش
والد
کامیت
93642b7ad5
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      deltachat-ios/Controller/ChatListController.swift

+ 2 - 1
deltachat-ios/Controller/ChatListController.swift

@@ -152,7 +152,8 @@ class ChatListController: UITableViewController {
             nc.removeObserver(msgsNoticedObserver)
         }
         // remove non-block observers
-        nc.removeObserver(self)
+        NotificationCenter.default.removeObserver(self, name: UIApplication.didBecomeActiveNotification, object: nil)
+        NotificationCenter.default.removeObserver(self, name: UIApplication.willResignActiveNotification, object: nil)
     }
     
     // MARK: - setup