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