Use new-style self-sizing cells on iOS 16
This commit is contained in:
parent
037b717e60
commit
10f6a68065
|
@ -255,9 +255,12 @@ extension NotificationsTableViewController: MenuActionProvider {
|
|||
|
||||
extension NotificationsTableViewController: StatusTableViewCellDelegate {
|
||||
func statusCellCollapsedStateChanged(_ cell: BaseStatusTableViewCell) {
|
||||
if #available(iOS 16.0, *) {
|
||||
} else {
|
||||
cellHeightChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension NotificationsTableViewController: UITableViewDataSourcePrefetching {
|
||||
func tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) {
|
||||
|
|
|
@ -265,9 +265,12 @@ extension ProfileStatusesViewController: TuskerNavigationDelegate {
|
|||
|
||||
extension ProfileStatusesViewController: StatusTableViewCellDelegate {
|
||||
func statusCellCollapsedStateChanged(_ cell: BaseStatusTableViewCell) {
|
||||
if #available(iOS 16.0, *) {
|
||||
} else {
|
||||
cellHeightChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension ProfileStatusesViewController: UITableViewDataSourcePrefetching, StatusTablePrefetching {
|
||||
func tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) {
|
||||
|
|
|
@ -290,9 +290,12 @@ extension TimelineTableViewController: TuskerNavigationDelegate {
|
|||
|
||||
extension TimelineTableViewController: StatusTableViewCellDelegate {
|
||||
func statusCellCollapsedStateChanged(_ cell: BaseStatusTableViewCell) {
|
||||
if #available(iOS 16.0, *) {
|
||||
} else {
|
||||
cellHeightChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension TimelineTableViewController: MenuActionProvider {
|
||||
}
|
||||
|
|
|
@ -163,6 +163,7 @@ class DiffableTimelineLikeTableViewController<Section: Hashable & CaseIterable,
|
|||
}
|
||||
}
|
||||
|
||||
@available(iOS, deprecated: 16.0)
|
||||
func cellHeightChanged() {
|
||||
// causes the table view to recalculate the cell heights
|
||||
tableView.beginUpdates()
|
||||
|
|
|
@ -12,6 +12,7 @@ import Combine
|
|||
import AVKit
|
||||
|
||||
protocol StatusTableViewCellDelegate: TuskerNavigationDelegate, MenuActionProvider {
|
||||
// @available(iOS, obsoleted: 16.0)
|
||||
func statusCellCollapsedStateChanged(_ cell: BaseStatusTableViewCell)
|
||||
}
|
||||
|
||||
|
@ -332,8 +333,12 @@ class BaseStatusTableViewCell: UITableViewCell {
|
|||
|
||||
@IBAction func collapseButtonPressed() {
|
||||
setCollapsed(!collapsed, animated: true)
|
||||
if #available(iOS 16.0, *) {
|
||||
invalidateIntrinsicContentSize()
|
||||
} else {
|
||||
delegate?.statusCellCollapsedStateChanged(self)
|
||||
}
|
||||
}
|
||||
|
||||
func setCollapsed(_ collapsed: Bool, animated: Bool) {
|
||||
self.collapsed = collapsed
|
||||
|
|
Loading…
Reference in New Issue