marinofaggiana 4 years ago
parent
commit
5d14af6196
1 changed files with 7 additions and 4 deletions
  1. 7 4
      iOSClient/Select/NCSelect.swift

+ 7 - 4
iOSClient/Select/NCSelect.swift

@@ -702,10 +702,13 @@ extension NCSelect: UICollectionViewDelegateFlowLayout {
 
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
         
-        if richWorkspaceText?.count ?? 0 == 0 {
-            headerRichWorkspaceHeight = 0
-        } else {
-            headerRichWorkspaceHeight = UIScreen.main.bounds.size.height / 4
+        headerRichWorkspaceHeight = 0
+        
+        if let richWorkspaceText = richWorkspaceText {
+            let trimmed = richWorkspaceText.trimmingCharacters(in: .whitespaces)
+            if trimmed.count > 0 {
+                headerRichWorkspaceHeight = UIScreen.main.bounds.size.height / 4
+            }
         }
         
         return CGSize(width: collectionView.frame.width, height: headerHeight + headerRichWorkspaceHeight)