marinofaggiana 5 rokov pred
rodič
commit
c5728ef852

+ 1 - 6
iOSClient/Main/CCMain.m

@@ -387,12 +387,7 @@
         if (appDelegate.player != nil && appDelegate.player.rate != 0) {
             [appDelegate.player pause];
         }
-        for (UIView *view in [appDelegate.activeDetail.view subviews]) {
-            if ([view isKindOfClass:[UIImageView class]] == NO) { // View Image Nextcloud
-                [view removeFromSuperview];
-            }
-        }
-        appDelegate.activeDetail.title = nil;
+        [appDelegate.activeDetail viewUnload];
         
         // remove all Notification Messages
         [appDelegate.listOfNotifications removeAllObjects];

+ 5 - 3
iOSClient/Main/NCDetailViewController.swift

@@ -100,7 +100,7 @@ class NCDetailViewController: UIViewController {
         return backgroundView.subviews.first
     }
     
-    func viewUnload() {
+    @objc func viewUnload() {
         
         metadata = nil
         selector = nil
@@ -111,8 +111,10 @@ class NCDetailViewController: UIViewController {
                     navigationController.popToRootViewController(animated: true)
                 }
             } else {
-                for view in backgroundView.subviews {
-                    view.removeFromSuperview()
+                if backgroundView != nil {
+                    for view in backgroundView.subviews {
+                        view.removeFromSuperview()
+                    }
                 }
                 self.navigationController?.navigationBar.topItem?.title = ""
             }