Fix crash when TimelineStatusTableViewCell outlives its containing VC

This commit is contained in:
Shadowfacts 2022-10-31 16:27:13 -04:00
parent 508eef8c07
commit b755607895
17 changed files with 18 additions and 18 deletions

View File

@ -65,7 +65,7 @@ class AccountListTableViewController: EnhancedTableViewController {
}
extension AccountListTableViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension AccountListTableViewController: ToastableViewController {

View File

@ -154,6 +154,7 @@ class BookmarksTableViewController: EnhancedTableViewController {
}
extension BookmarksTableViewController: TuskerNavigationDelegate {
var apiController: MastodonController! { mastodonController }
}
extension BookmarksTableViewController: ToastableViewController {
@ -163,8 +164,6 @@ extension BookmarksTableViewController: MenuActionProvider {
}
extension BookmarksTableViewController: StatusTableViewCellDelegate {
var apiController: MastodonController { mastodonController }
func statusCellCollapsedStateChanged(_ cell: BaseStatusTableViewCell) {
tableView.beginUpdates()
tableView.endUpdates()

View File

@ -441,6 +441,8 @@ extension ConversationTableViewController {
}
extension ConversationTableViewController: TuskerNavigationDelegate {
var apiController: MastodonController! { mastodonController }
func conversation(mainStatusID: String, state: StatusState) -> ConversationTableViewController {
let vc = ConversationTableViewController(for: mainStatusID, state: state, mastodonController: mastodonController)
// transfer show statuses automatically state when showing new conversation
@ -453,7 +455,6 @@ extension ConversationTableViewController: MenuActionProvider {
}
extension ConversationTableViewController: StatusTableViewCellDelegate {
var apiController: MastodonController { mastodonController }
func statusCellCollapsedStateChanged(_ cell: BaseStatusTableViewCell) {
// causes the table view to recalculate the cell heights
tableView.beginUpdates()

View File

@ -147,7 +147,7 @@ extension ProfileDirectoryViewController {
}
extension ProfileDirectoryViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension ProfileDirectoryViewController: ToastableViewController {

View File

@ -120,7 +120,7 @@ extension TrendingHashtagsViewController: UICollectionViewDragDelegate {
}
extension TrendingHashtagsViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension TrendingHashtagsViewController: ToastableViewController {

View File

@ -101,7 +101,7 @@ extension TrendingLinksViewController {
}
extension TrendingLinksViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension TrendingLinksViewController: ToastableViewController {

View File

@ -82,7 +82,7 @@ extension TrendingStatusesViewController {
}
extension TrendingStatusesViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension TrendingStatusesViewController: ToastableViewController {

View File

@ -174,7 +174,7 @@ extension EditListAccountsViewController: SearchResultsViewControllerDelegate {
}
extension EditListAccountsViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension EditListAccountsViewController: ToastableViewController {

View File

@ -269,7 +269,7 @@ extension NotificationsTableViewController {
}
extension NotificationsTableViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension NotificationsTableViewController: MenuActionProvider {

View File

@ -455,7 +455,7 @@ extension ProfileStatusesViewController: UICollectionViewDragDelegate {
}
extension ProfileStatusesViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension ProfileStatusesViewController: MenuActionProvider {

View File

@ -279,7 +279,7 @@ extension ProfileViewController {
}
extension ProfileViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension ProfileViewController: ToastableViewController {

View File

@ -289,6 +289,7 @@ extension SearchResultsViewController: UISearchBarDelegate {
}
extension SearchResultsViewController: TuskerNavigationDelegate {
var apiController: MastodonController! { mastodonController }
}
extension SearchResultsViewController: ToastableViewController {
@ -298,7 +299,6 @@ extension SearchResultsViewController: MenuActionProvider {
}
extension SearchResultsViewController: StatusTableViewCellDelegate {
var apiController: MastodonController { mastodonController }
func statusCellCollapsedStateChanged(_ cell: BaseStatusTableViewCell) {
tableView.beginUpdates()
tableView.endUpdates()

View File

@ -319,7 +319,7 @@ extension SearchViewController: UICollectionViewDragDelegate {
}
extension SearchViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension SearchViewController: ToastableViewController {

View File

@ -145,6 +145,7 @@ class StatusActionAccountListTableViewController: EnhancedTableViewController {
}
extension StatusActionAccountListTableViewController: TuskerNavigationDelegate {
var apiController: MastodonController! { mastodonController }
}
extension StatusActionAccountListTableViewController: ToastableViewController {
@ -154,7 +155,6 @@ extension StatusActionAccountListTableViewController: MenuActionProvider {
}
extension StatusActionAccountListTableViewController: StatusTableViewCellDelegate {
var apiController: MastodonController { mastodonController }
func statusCellCollapsedStateChanged(_ cell: BaseStatusTableViewCell) {
// causes the table view to recalculate the cell heights
tableView.beginUpdates()

View File

@ -294,7 +294,7 @@ extension TimelineTableViewController {
}
extension TimelineTableViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension TimelineTableViewController: StatusTableViewCellDelegate {

View File

@ -398,7 +398,7 @@ extension TimelineViewController: UICollectionViewDragDelegate {
}
extension TimelineViewController: TuskerNavigationDelegate {
var apiController: MastodonController { mastodonController }
var apiController: MastodonController! { mastodonController }
}
extension TimelineViewController: MenuActionProvider {

View File

@ -11,7 +11,7 @@ import SafariServices
import Pachyderm
protocol TuskerNavigationDelegate: UIViewController, ToastableViewController {
var apiController: MastodonController { get }
var apiController: MastodonController! { get }
func conversation(mainStatusID: String, state: StatusState) -> ConversationTableViewController
}