ارفع راسك فوق انته سوري حر ... 💚💚

Skip to content
Snippets Groups Projects
Commit f6154578 authored by George's avatar George
Browse files

add no files label

parent 42b3e31c
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -57,11 +57,22 @@
<rect key="frame" x="0.0" y="80" width="414" height="450"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</tableView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ajy-r2-7bl">
<rect key="frame" x="186" y="293.5" width="42" height="23"/>
<constraints>
<constraint firstAttribute="height" constant="23" id="bYF-Kp-biZ"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="ajy-r2-7bl" firstAttribute="centerX" secondItem="60c-jY-XTk" secondAttribute="centerX" id="CFl-aU-ole"/>
<constraint firstItem="60c-jY-XTk" firstAttribute="top" secondItem="VPm-dN-3u7" secondAttribute="bottom" id="EMn-mL-Oiq"/>
<constraint firstItem="60c-jY-XTk" firstAttribute="leading" secondItem="27n-zM-bE7" secondAttribute="leading" id="MOu-65-XoB"/>
<constraint firstItem="ajy-r2-7bl" firstAttribute="centerY" secondItem="60c-jY-XTk" secondAttribute="centerY" id="PxK-GE-7KL"/>
<constraint firstAttribute="trailing" secondItem="VPm-dN-3u7" secondAttribute="trailing" id="SqO-9W-uqD"/>
<constraint firstAttribute="bottom" secondItem="60c-jY-XTk" secondAttribute="bottom" constant="24" id="hxd-n2-r1v"/>
<constraint firstAttribute="trailing" secondItem="60c-jY-XTk" secondAttribute="trailing" id="odE-ga-ZOX"/>
......@@ -87,6 +98,7 @@
<outlet property="AllFolderView" destination="7uR-kU-jQL" id="fWz-Eg-JcR"/>
<outlet property="allFolderView_height" destination="qZv-Hx-LJ7" id="4LY-Kr-mUv"/>
<outlet property="fixedTableSheet" destination="27n-zM-bE7" id="5zJ-W1-AKn"/>
<outlet property="noFilesLabel" destination="ajy-r2-7bl" id="ioM-6Q-2J0"/>
<outlet property="searchForFilesView" destination="VPm-dN-3u7" id="YhB-5N-43R"/>
<outlet property="tableView" destination="60c-jY-XTk" id="ck5-Mw-NDZ"/>
</connections>
......
......@@ -26,6 +26,7 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate,
@IBOutlet weak var fixedTableSheet: UIView!
@IBOutlet weak var searchForFilesView: SearchFilesView!
@IBOutlet weak var noFilesLabel: UILabel!
private var viewModels: [File] = []
private var searchedViewModel: [File] = []
......@@ -91,6 +92,8 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate,
fixedTableSheet.layer.shadowRadius = 4.0
fixedTableSheet.backgroundColor = .white // or any non-clear color
fixedTableSheet.clipsToBounds = false
noFilesLabel.set(text: "No Files to show", color: .mainText, font: .medium(22))
noFilesLabel.isHidden = true
fetchViewModels()
}
......@@ -111,6 +114,12 @@ final class DocumentsTableViewController: UIViewController, UITableViewDelegate,
self.viewModels = viewModels
self.searchedViewModel = viewModels
AllFolderView?.set(selectedFolder: folder, delegate: self)
if viewModels.isEmpty {
noFilesLabel.isHidden = false
} else {
noFilesLabel.isHidden = true
}
tableView.reloadData()
}
}
......@@ -405,10 +414,16 @@ extension DocumentsTableViewController: SearchFilesViewDelegate {
UIView.animate(withDuration: 0.5) {
self.allFolderView_height.constant = 240
self.AllFolderView.isHidden = false
self.noFilesLabel.isHidden = true
}
} else {
isSearching = true
self.searchedViewModel = self.viewModels.filter { $0.displayName.lowercased().contains(text.lowercased()) }
if searchedViewModel.isEmpty {
noFilesLabel.isHidden = false
} else {
noFilesLabel.isHidden = true
}
}
tableView.reloadData()
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment