소스 검색

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 년 전
부모
커밋
9c383b173f
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

+ 9 - 0
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -169,6 +169,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
 
         NotificationCenter.default.addObserver(self, selector: #selector(triggerProgressTask(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterProgressTask), object: nil)
 
+        NotificationCenter.default.addObserver(self, selector: #selector(applicationWillEnterForeground(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterApplicationWillEnterForeground), object: nil)
+
         if serverUrl == "" {
             appDelegate.activeServerUrl = NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account)
         } else {
@@ -218,6 +220,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
 
         NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterProgressTask), object: nil)
 
+        NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterApplicationWillEnterForeground), object: nil)
+
         pushed = false
 
         // REQUEST
@@ -337,6 +341,11 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         collectionView.reloadData()
     }
 
+    @objc func applicationWillEnterForeground(_ notification: NSNotification) {
+
+        collectionView?.reloadData()
+    }
+
     @objc func reloadDataSource(_ notification: NSNotification) {
 
         reloadDataSource()