Skip to content

Instantly share code, notes, and snippets.

@frosty

frosty/foo.diff

Created Aug 28, 2019
Embed
What would you like to do?
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
You can’t perform that action at this time.