From 6aee926f006fa8dc6676551b2dadd13d42de3c52 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 19 Jan 2023 13:13:01 -0500 Subject: [PATCH] Fix table views being too far inset on iPhone --- .../Conversation/ConversationTableViewController.swift | 4 ++-- .../Notifications/NotificationsTableViewController.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tusker/Screens/Conversation/ConversationTableViewController.swift b/Tusker/Screens/Conversation/ConversationTableViewController.swift index 297350d7..d678c1c4 100644 --- a/Tusker/Screens/Conversation/ConversationTableViewController.swift +++ b/Tusker/Screens/Conversation/ConversationTableViewController.swift @@ -62,8 +62,8 @@ class ConversationTableViewController: EnhancedTableViewController { // separators are disabled on the table view so we can re-add them ourselves // so they're not inserted in between statuses in the ame sub-thread tableView.separatorStyle = .none - tableView.cellLayoutMarginsFollowReadableWidth = true - + tableView.cellLayoutMarginsFollowReadableWidth = UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac + dataSource = UITableViewDiffableDataSource(tableView: tableView, cellProvider: { (tableView, indexPath, item) -> UITableViewCell? in switch item { case let .status(id: id, state: state): diff --git a/Tusker/Screens/Notifications/NotificationsTableViewController.swift b/Tusker/Screens/Notifications/NotificationsTableViewController.swift index 7c974d5f..dd258b85 100644 --- a/Tusker/Screens/Notifications/NotificationsTableViewController.swift +++ b/Tusker/Screens/Notifications/NotificationsTableViewController.swift @@ -56,7 +56,7 @@ class NotificationsTableViewController: DiffableTimelineLikeTableViewController< tableView.register(UINib(nibName: "StatusUpdatedNotificationTableViewCell", bundle: .main), forCellReuseIdentifier: updatedCell) tableView.register(UINib(nibName: "BasicTableViewCell", bundle: .main), forCellReuseIdentifier: unknownCell) - tableView.cellLayoutMarginsFollowReadableWidth = true + tableView.cellLayoutMarginsFollowReadableWidth = UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac tableView.allowsFocus = true NotificationCenter.default.addObserver(self, selector: #selector(handleStatusDeleted), name: .statusDeleted, object: nil)