Skip to content

Instantly share code, notes, and snippets.

@frosty
Created August 28, 2019 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frosty/54bd15e76da823c836bc251255c344d3 to your computer and use it in GitHub Desktop.
Save frosty/54bd15e76da823c836bc251255c344d3 to your computer and use it in GitHub Desktop.
diff --git a/WordPress/Classes/ViewRelated/Post/AuthorFilterViewController.swift b/WordPress/Classes/ViewRelated/Post/AuthorFilterViewController.swift
index 157eeaad3e..40cf9b1844 100644
--- a/WordPress/Classes/ViewRelated/Post/AuthorFilterViewController.swift
+++ b/WordPress/Classes/ViewRelated/Post/AuthorFilterViewController.swift
@@ -45,7 +45,7 @@ class AuthorFilterViewController: UITableViewController {
tableView.rowHeight = Metrics.rowHeight
tableView.separatorInset = .zero
- tableView.separatorColor = .neutral(.shade10)
+ tableView.separatorColor = .clear
tableView.isScrollEnabled = false
tableView.showsVerticalScrollIndicator = false
if #available(iOS 13, *) {
@@ -95,9 +95,28 @@ class AuthorFilterViewController: UITableViewController {
cell.title = filter.stringValue
}
+ if indexPath.row == 0 {
+ addSeparator(to: cell)
+ }
+
return cell
}
+ private func addSeparator(to cell: UITableViewCell) {
+ let divider = UIView()
+ divider.backgroundColor = .divider
+
+ divider.translatesAutoresizingMaskIntoConstraints = false
+ cell.addSubview(divider)
+
+ NSLayoutConstraint.activate([
+ divider.leadingAnchor.constraint(equalTo: cell.leadingAnchor),
+ divider.trailingAnchor.constraint(equalTo: cell.trailingAnchor),
+ divider.bottomAnchor.constraint(equalTo: cell.bottomAnchor),
+ divider.heightAnchor.constraint(equalToConstant: .hairlineBorderWidth)
+ ])
+ }
+
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard let filter = PostListFilterSettings.AuthorFilter(rawValue: UInt(indexPath.row)) else {
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment