Created
August 28, 2019 18:42
-
-
Save frosty/54bd15e76da823c836bc251255c344d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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