Эх сурвалжийг харах

coding

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 жил өмнө
parent
commit
07c21e31cf

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

@@ -169,8 +169,6 @@ 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 {
@@ -220,8 +218,6 @@ 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
@@ -341,11 +337,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         collectionView.reloadData()
     }
 
-    @objc func applicationWillEnterForeground(_ notification: NSNotification) {
-
-        collectionView?.reloadData()
-    }
-
     @objc func reloadDataSource(_ notification: NSNotification) {
 
         reloadDataSource()

+ 1 - 14
iOSClient/Transfers/NCTransfers.swift

@@ -48,15 +48,8 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
         super.viewDidLoad()
 
         listLayout.itemHeight = 105
-        collectionView?.collectionViewLayout = listLayout
+        NCUtility.shared.setLayoutForView(key: layoutKey, serverUrl: serverUrl, layout: NCGlobal.shared.layoutList)
         self.navigationItem.title = titleCurrentFolder
-        serverUrl = appDelegate.activeServerUrl
-    }
-
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-
-        collectionView?.collectionViewLayout = listLayout
     }
 
     override func setNavigationItem() {
@@ -66,12 +59,6 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
 
     // MARK: - NotificationCenter
 
-    override func applicationWillEnterForeground(_ notification: NSNotification) {
-
-        collectionView?.collectionViewLayout = listLayout
-        reloadDataSource()
-    }
-
     override func downloadStartFile(_ notification: NSNotification) {
 
         reloadDataSource()