Skip to content

Commit

Permalink
Filter non-private info sections only. (#62)
Browse files Browse the repository at this point in the history
* Filter non-private info sections only.

* Fix reload button.
  • Loading branch information
yspreen authored May 11, 2021
1 parent e9f3c22 commit 9567440
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion DGCAVerifier/Storyboards/Base.lproj/Settings.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LEB-UD-iNN">
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LEB-UD-iNN">
<rect key="frame" x="356" y="0.0" width="50" height="50"/>
<constraints>
<constraint firstAttribute="width" secondItem="LEB-UD-iNN" secondAttribute="height" multiplier="1:1" id="QaP-dH-dzW"/>
</constraints>
<color key="tintColor" name="blue"/>
<state key="normal" image="spinner"/>
</button>
</subviews>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
10 changes: 8 additions & 2 deletions DGCAVerifier/ViewControllers/CertificateViewer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,22 @@ class CertificateViewerVC: UIViewController {
}

extension CertificateViewerVC: UITableViewDataSource {
var listItems: [InfoSection] {
hCert.info.filter {
!$0.isPrivate
}
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return hCert.info.count
return listItems.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let base = tableView.dequeueReusableCell(withIdentifier: "infoCell", for: indexPath)
guard let cell = base as? InfoCell else {
return base
}
cell.draw(hCert.info[indexPath.row])
cell.draw(listItems[indexPath.row])
return cell
}
}

0 comments on commit 9567440

Please sign in to comment.