marinofaggiana 4 years ago
parent
commit
c8f769fe95
1 changed files with 6 additions and 3 deletions
  1. 6 3
      iOSClient/EmptyView/NCEmptyDataSet.swift

+ 6 - 3
iOSClient/EmptyView/NCEmptyDataSet.swift

@@ -15,7 +15,6 @@ class NCEmptyDataSet: NSObject {
     init(view: UIView, image: UIImage?, title: String, description: String, offset: CGFloat) {
         super.init()
 
-        
         if let emptyView = UINib(nibName: "NCEmptyView", bundle: nil).instantiate(withOwner: self, options: nil).first as? NCEmptyView {
         
             self.emptyView = emptyView
@@ -39,9 +38,13 @@ class NCEmptyDataSet: NSObject {
     
     func numberOfItemsInSection(_ numberItems: Int) {
         if numberItems == 0 {
-            emptyView?.isHidden = false
+            DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
+                self.emptyView?.isHidden = false
+            }
         } else {
-            emptyView?.isHidden = true
+            DispatchQueue.main.asyncAfter(deadline: .now() + 0.0) {
+                self.emptyView?.isHidden = true
+            }
         }
     }
 }