fix: status menu cause memory leaking issue
This commit is contained in:
parent
c88daf56be
commit
80ea6ac913
|
@ -67,7 +67,6 @@ extension StatusSection {
|
||||||
timelineContext: TimelineContext,
|
timelineContext: TimelineContext,
|
||||||
dependency: NeedsDependency,
|
dependency: NeedsDependency,
|
||||||
managedObjectContext: NSManagedObjectContext,
|
managedObjectContext: NSManagedObjectContext,
|
||||||
timestampUpdatePublisher: AnyPublisher<Date, Never>,
|
|
||||||
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: TimelineMiddleLoaderTableViewCellDelegate?,
|
timelineMiddleLoaderTableViewCellDelegate: TimelineMiddleLoaderTableViewCellDelegate?,
|
||||||
threadReplyLoaderTableViewCellDelegate: ThreadReplyLoaderTableViewCellDelegate?
|
threadReplyLoaderTableViewCellDelegate: ThreadReplyLoaderTableViewCellDelegate?
|
||||||
|
@ -363,7 +362,6 @@ extension StatusSection {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
||||||
if status.author.id == requestUserID || status.reblog?.author.id == requestUserID {
|
if status.author.id == requestUserID || status.reblog?.author.id == requestUserID {
|
||||||
// do not filter myself
|
// do not filter myself
|
||||||
} else {
|
} else {
|
||||||
|
@ -473,9 +471,10 @@ extension StatusSection {
|
||||||
.receive(on: RunLoop.main)
|
.receive(on: RunLoop.main)
|
||||||
.sink { _ in
|
.sink { _ in
|
||||||
// do nothing
|
// do nothing
|
||||||
} receiveValue: { [weak cell, weak tableView] change in
|
} receiveValue: { [weak cell, weak tableView, weak dependency] change in
|
||||||
guard let cell = cell else { return }
|
guard let cell = cell else { return }
|
||||||
guard let tableView = tableView else { return }
|
guard let tableView = tableView else { return }
|
||||||
|
guard let dependency = dependency else { return }
|
||||||
guard case .update(let object) = change.changeType,
|
guard case .update(let object) = change.changeType,
|
||||||
let status = object as? Status, !status.isDeleted else {
|
let status = object as? Status, !status.isDeleted else {
|
||||||
return
|
return
|
||||||
|
@ -1072,7 +1071,7 @@ extension StatusSection {
|
||||||
cell.statusView.actionToolbarContainer.reblogButton.isEnabled = false
|
cell.statusView.actionToolbarContainer.reblogButton.isEnabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set like
|
// set like
|
||||||
let isLike = status.favouritedBy.flatMap { $0.contains(where: { $0.id == requestUserID }) } ?? false
|
let isLike = status.favouritedBy.flatMap { $0.contains(where: { $0.id == requestUserID }) } ?? false
|
||||||
let favoriteCountTitle: String = {
|
let favoriteCountTitle: String = {
|
||||||
|
@ -1107,7 +1106,7 @@ extension StatusSection {
|
||||||
StatusSection.setupStatusMoreButtonMenu(cell: cell, dependency: dependency, status: status)
|
StatusSection.setupStatusMoreButtonMenu(cell: cell, dependency: dependency, status: status)
|
||||||
})
|
})
|
||||||
.store(in: &cell.disposeBag)
|
.store(in: &cell.disposeBag)
|
||||||
self.setupStatusMoreButtonMenu(cell: cell, dependency: dependency, status: status)
|
setupStatusMoreButtonMenu(cell: cell, dependency: dependency, status: status)
|
||||||
}
|
}
|
||||||
|
|
||||||
static func configureStatusAccessibilityLabel(cell: StatusTableViewCell) {
|
static func configureStatusAccessibilityLabel(cell: StatusTableViewCell) {
|
||||||
|
|
|
@ -212,8 +212,17 @@ extension UserProviderFacade {
|
||||||
let name = mastodonUser.displayNameWithFallback
|
let name = mastodonUser.displayNameWithFallback
|
||||||
|
|
||||||
if let shareUser = shareUser {
|
if let shareUser = shareUser {
|
||||||
let shareAction = UIAction(title: L10n.Common.Controls.Actions.shareUser(name), image: UIImage(systemName: "square.and.arrow.up"), identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off) { [weak provider] _ in
|
let shareAction = UIAction(
|
||||||
|
title: L10n.Common.Controls.Actions.shareUser(name),
|
||||||
|
image: UIImage(systemName: "square.and.arrow.up"),
|
||||||
|
identifier: nil,
|
||||||
|
discoverabilityTitle: nil,
|
||||||
|
attributes: [],
|
||||||
|
state: .off
|
||||||
|
) { [weak provider, weak sourceView, weak barButtonItem] _ in
|
||||||
guard let provider = provider else { return }
|
guard let provider = provider else { return }
|
||||||
|
guard let sourceView = sourceView else { return }
|
||||||
|
guard let barButtonItem = barButtonItem else { return }
|
||||||
let activityViewController = createActivityViewControllerForMastodonUser(mastodonUser: shareUser, dependency: provider)
|
let activityViewController = createActivityViewControllerForMastodonUser(mastodonUser: shareUser, dependency: provider)
|
||||||
provider.coordinator.present(
|
provider.coordinator.present(
|
||||||
scene: .activityViewController(
|
scene: .activityViewController(
|
||||||
|
@ -229,8 +238,17 @@ extension UserProviderFacade {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let shareStatus = shareStatus {
|
if let shareStatus = shareStatus {
|
||||||
let shareAction = UIAction(title: L10n.Common.Controls.Actions.sharePost, image: UIImage(systemName: "square.and.arrow.up"), identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off) { [weak provider] _ in
|
let shareAction = UIAction(
|
||||||
|
title: L10n.Common.Controls.Actions.sharePost,
|
||||||
|
image: UIImage(systemName: "square.and.arrow.up"),
|
||||||
|
identifier: nil,
|
||||||
|
discoverabilityTitle: nil,
|
||||||
|
attributes: [],
|
||||||
|
state: .off
|
||||||
|
) { [weak provider, weak sourceView, weak barButtonItem] _ in
|
||||||
guard let provider = provider else { return }
|
guard let provider = provider else { return }
|
||||||
|
guard let sourceView = sourceView else { return }
|
||||||
|
guard let barButtonItem = barButtonItem else { return }
|
||||||
let activityViewController = createActivityViewControllerForMastodonUser(status: shareStatus, dependency: provider)
|
let activityViewController = createActivityViewControllerForMastodonUser(status: shareStatus, dependency: provider)
|
||||||
provider.coordinator.present(
|
provider.coordinator.present(
|
||||||
scene: .activityViewController(
|
scene: .activityViewController(
|
||||||
|
@ -253,8 +271,9 @@ extension UserProviderFacade {
|
||||||
discoverabilityTitle: isMuting ? nil : L10n.Common.Controls.Friendship.muteUser(name),
|
discoverabilityTitle: isMuting ? nil : L10n.Common.Controls.Friendship.muteUser(name),
|
||||||
attributes: isMuting ? [] : .destructive,
|
attributes: isMuting ? [] : .destructive,
|
||||||
state: .off
|
state: .off
|
||||||
) { [weak provider] _ in
|
) { [weak provider, weak cell] _ in
|
||||||
guard let provider = provider else { return }
|
guard let provider = provider else { return }
|
||||||
|
guard let cell = cell else { return }
|
||||||
|
|
||||||
UserProviderFacade.toggleUserMuteRelationship(
|
UserProviderFacade.toggleUserMuteRelationship(
|
||||||
provider: provider,
|
provider: provider,
|
||||||
|
@ -283,8 +302,9 @@ extension UserProviderFacade {
|
||||||
discoverabilityTitle: isBlocking ? nil : L10n.Common.Controls.Friendship.blockUser(name),
|
discoverabilityTitle: isBlocking ? nil : L10n.Common.Controls.Friendship.blockUser(name),
|
||||||
attributes: isBlocking ? [] : .destructive,
|
attributes: isBlocking ? [] : .destructive,
|
||||||
state: .off
|
state: .off
|
||||||
) { [weak provider] _ in
|
) { [weak provider, weak cell] _ in
|
||||||
guard let provider = provider else { return }
|
guard let provider = provider else { return }
|
||||||
|
guard let cell = cell else { return }
|
||||||
|
|
||||||
UserProviderFacade.toggleUserBlockRelationship(
|
UserProviderFacade.toggleUserBlockRelationship(
|
||||||
provider: provider,
|
provider: provider,
|
||||||
|
@ -306,7 +326,14 @@ extension UserProviderFacade {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !isMyself {
|
if !isMyself {
|
||||||
let reportAction = UIAction(title: L10n.Common.Controls.Actions.reportUser(name), image: UIImage(systemName: "flag"), identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off) { [weak provider] _ in
|
let reportAction = UIAction(
|
||||||
|
title: L10n.Common.Controls.Actions.reportUser(name),
|
||||||
|
image: UIImage(systemName: "flag"),
|
||||||
|
identifier: nil,
|
||||||
|
discoverabilityTitle: nil,
|
||||||
|
attributes: [],
|
||||||
|
state: .off
|
||||||
|
) { [weak provider] _ in
|
||||||
guard let provider = provider else { return }
|
guard let provider = provider else { return }
|
||||||
guard let authenticationBox = provider.context.authenticationService.activeMastodonAuthenticationBox.value else {
|
guard let authenticationBox = provider.context.authenticationService.activeMastodonAuthenticationBox.value else {
|
||||||
return
|
return
|
||||||
|
@ -328,19 +355,37 @@ extension UserProviderFacade {
|
||||||
|
|
||||||
if !isInSameDomain {
|
if !isInSameDomain {
|
||||||
if isDomainBlocking {
|
if isDomainBlocking {
|
||||||
let unblockDomainAction = UIAction(title: L10n.Common.Controls.Actions.unblockDomain(mastodonUser.domainFromAcct), image: UIImage(systemName: "nosign"), identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off) { [weak provider] _ in
|
let unblockDomainAction = UIAction(
|
||||||
|
title: L10n.Common.Controls.Actions.unblockDomain(mastodonUser.domainFromAcct),
|
||||||
|
image: UIImage(systemName: "nosign"),
|
||||||
|
identifier: nil,
|
||||||
|
discoverabilityTitle: nil,
|
||||||
|
attributes: [],
|
||||||
|
state: .off
|
||||||
|
) { [weak provider, weak cell] _ in
|
||||||
guard let provider = provider else { return }
|
guard let provider = provider else { return }
|
||||||
|
guard let cell = cell else { return }
|
||||||
provider.context.blockDomainService.unblockDomain(userProvider: provider, cell: cell)
|
provider.context.blockDomainService.unblockDomain(userProvider: provider, cell: cell)
|
||||||
}
|
}
|
||||||
children.append(unblockDomainAction)
|
children.append(unblockDomainAction)
|
||||||
} else {
|
} else {
|
||||||
let blockDomainAction = UIAction(title: L10n.Common.Controls.Actions.blockDomain(mastodonUser.domainFromAcct), image: UIImage(systemName: "nosign"), identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off) { [weak provider] _ in
|
let blockDomainAction = UIAction(
|
||||||
|
title: L10n.Common.Controls.Actions.blockDomain(mastodonUser.domainFromAcct),
|
||||||
|
image: UIImage(systemName: "nosign"),
|
||||||
|
identifier: nil,
|
||||||
|
discoverabilityTitle: nil,
|
||||||
|
attributes: [],
|
||||||
|
state: .off
|
||||||
|
) { [weak provider, weak cell] _ in
|
||||||
guard let provider = provider else { return }
|
guard let provider = provider else { return }
|
||||||
|
guard let cell = cell else { return }
|
||||||
|
|
||||||
let alertController = UIAlertController(title: L10n.Common.Alerts.BlockDomain.title(mastodonUser.domainFromAcct), message: nil, preferredStyle: .alert)
|
let alertController = UIAlertController(title: L10n.Common.Alerts.BlockDomain.title(mastodonUser.domainFromAcct), message: nil, preferredStyle: .alert)
|
||||||
let cancelAction = UIAlertAction(title: L10n.Common.Controls.Actions.cancel, style: .default) { _ in
|
let cancelAction = UIAlertAction(title: L10n.Common.Controls.Actions.cancel, style: .default) { _ in }
|
||||||
}
|
|
||||||
alertController.addAction(cancelAction)
|
alertController.addAction(cancelAction)
|
||||||
let blockDomainAction = UIAlertAction(title: L10n.Common.Alerts.BlockDomain.blockEntireDomain, style: .destructive) { _ in
|
let blockDomainAction = UIAlertAction(title: L10n.Common.Alerts.BlockDomain.blockEntireDomain, style: .destructive) { [weak provider, weak cell] _ in
|
||||||
|
guard let provider = provider else { return }
|
||||||
|
guard let cell = cell else { return }
|
||||||
provider.context.blockDomainService.blockDomain(userProvider: provider, cell: cell)
|
provider.context.blockDomainService.blockDomain(userProvider: provider, cell: cell)
|
||||||
}
|
}
|
||||||
alertController.addAction(blockDomainAction)
|
alertController.addAction(blockDomainAction)
|
||||||
|
@ -351,19 +396,26 @@ extension UserProviderFacade {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let status = shareStatus, isMyself {
|
if let status = shareStatus, isMyself {
|
||||||
let deleteAction = UIAction(title: L10n.Common.Controls.Actions.delete, image: UIImage(systemName: "delete.left"), identifier: nil, discoverabilityTitle: nil, attributes: [.destructive], state: .off) {
|
let deleteAction = UIAction(
|
||||||
[weak provider] _ in
|
title: L10n.Common.Controls.Actions.delete,
|
||||||
|
image: UIImage(systemName: "delete.left"),
|
||||||
|
identifier: nil,
|
||||||
|
discoverabilityTitle: nil,
|
||||||
|
attributes: [.destructive],
|
||||||
|
state: .off
|
||||||
|
) { [weak provider] _ in
|
||||||
guard let provider = provider else { return }
|
guard let provider = provider else { return }
|
||||||
|
|
||||||
let alertController = UIAlertController(title: L10n.Common.Alerts.DeletePost.title, message: nil, preferredStyle: .alert)
|
let alertController = UIAlertController(title: L10n.Common.Alerts.DeletePost.title, message: nil, preferredStyle: .alert)
|
||||||
let cancelAction = UIAlertAction(title: L10n.Common.Controls.Actions.cancel, style: .default) { _ in
|
let cancelAction = UIAlertAction(title: L10n.Common.Controls.Actions.cancel, style: .default) { _ in }
|
||||||
}
|
|
||||||
alertController.addAction(cancelAction)
|
alertController.addAction(cancelAction)
|
||||||
let deleteAction = UIAlertAction(title: L10n.Common.Alerts.DeletePost.delete, style: .destructive) { _ in
|
let deleteAction = UIAlertAction(title: L10n.Common.Alerts.DeletePost.delete, style: .destructive) { [weak provider] _ in
|
||||||
|
guard let provider = provider else { return }
|
||||||
guard let activeMastodonAuthenticationBox = provider.context.authenticationService.activeMastodonAuthenticationBox.value else { return }
|
guard let activeMastodonAuthenticationBox = provider.context.authenticationService.activeMastodonAuthenticationBox.value else { return }
|
||||||
provider.context.apiService.deleteStatus(domain: activeMastodonAuthenticationBox.domain,
|
provider.context.apiService.deleteStatus(
|
||||||
statusID: status.id,
|
domain: activeMastodonAuthenticationBox.domain,
|
||||||
authorizationBox: activeMastodonAuthenticationBox
|
statusID: status.id,
|
||||||
|
authorizationBox: activeMastodonAuthenticationBox
|
||||||
)
|
)
|
||||||
.sink { _ in
|
.sink { _ in
|
||||||
// do nothing
|
// do nothing
|
||||||
|
@ -374,7 +426,6 @@ extension UserProviderFacade {
|
||||||
}
|
}
|
||||||
alertController.addAction(deleteAction)
|
alertController.addAction(deleteAction)
|
||||||
provider.present(alertController, animated: true, completion: nil)
|
provider.present(alertController, animated: true, completion: nil)
|
||||||
|
|
||||||
}
|
}
|
||||||
children.append(deleteAction)
|
children.append(deleteAction)
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,17 +17,11 @@ extension HashtagTimelineViewModel {
|
||||||
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: TimelineMiddleLoaderTableViewCellDelegate
|
timelineMiddleLoaderTableViewCellDelegate: TimelineMiddleLoaderTableViewCellDelegate
|
||||||
) {
|
) {
|
||||||
let timestampUpdatePublisher = Timer.publish(every: 1.0, on: .main, in: .common)
|
|
||||||
.autoconnect()
|
|
||||||
.share()
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
|
|
||||||
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
||||||
for: tableView,
|
for: tableView,
|
||||||
timelineContext: .hashtag,
|
timelineContext: .hashtag,
|
||||||
dependency: dependency,
|
dependency: dependency,
|
||||||
managedObjectContext: context.managedObjectContext,
|
managedObjectContext: context.managedObjectContext,
|
||||||
timestampUpdatePublisher: timestampUpdatePublisher,
|
|
||||||
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: timelineMiddleLoaderTableViewCellDelegate,
|
timelineMiddleLoaderTableViewCellDelegate: timelineMiddleLoaderTableViewCellDelegate,
|
||||||
threadReplyLoaderTableViewCellDelegate: nil
|
threadReplyLoaderTableViewCellDelegate: nil
|
||||||
|
|
|
@ -18,17 +18,11 @@ extension HomeTimelineViewModel {
|
||||||
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: TimelineMiddleLoaderTableViewCellDelegate
|
timelineMiddleLoaderTableViewCellDelegate: TimelineMiddleLoaderTableViewCellDelegate
|
||||||
) {
|
) {
|
||||||
let timestampUpdatePublisher = Timer.publish(every: 1.0, on: .main, in: .common)
|
|
||||||
.autoconnect()
|
|
||||||
.share()
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
|
|
||||||
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
||||||
for: tableView,
|
for: tableView,
|
||||||
timelineContext: .home,
|
timelineContext: .home,
|
||||||
dependency: dependency,
|
dependency: dependency,
|
||||||
managedObjectContext: fetchedResultsController.managedObjectContext,
|
managedObjectContext: fetchedResultsController.managedObjectContext,
|
||||||
timestampUpdatePublisher: timestampUpdatePublisher,
|
|
||||||
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: timelineMiddleLoaderTableViewCellDelegate,
|
timelineMiddleLoaderTableViewCellDelegate: timelineMiddleLoaderTableViewCellDelegate,
|
||||||
threadReplyLoaderTableViewCellDelegate: nil
|
threadReplyLoaderTableViewCellDelegate: nil
|
||||||
|
|
|
@ -42,6 +42,10 @@ final class NotificationViewController: UIViewController, NeedsDependency {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
let refreshControl = UIRefreshControl()
|
let refreshControl = UIRefreshControl()
|
||||||
|
|
||||||
|
deinit {
|
||||||
|
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension NotificationViewController {
|
extension NotificationViewController {
|
||||||
|
|
|
@ -13,18 +13,12 @@ extension FavoriteViewModel {
|
||||||
for tableView: UITableView,
|
for tableView: UITableView,
|
||||||
dependency: NeedsDependency,
|
dependency: NeedsDependency,
|
||||||
statusTableViewCellDelegate: StatusTableViewCellDelegate
|
statusTableViewCellDelegate: StatusTableViewCellDelegate
|
||||||
) {
|
) {
|
||||||
let timestampUpdatePublisher = Timer.publish(every: 1.0, on: .main, in: .common)
|
|
||||||
.autoconnect()
|
|
||||||
.share()
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
|
|
||||||
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
||||||
for: tableView,
|
for: tableView,
|
||||||
timelineContext: .favorite,
|
timelineContext: .favorite,
|
||||||
dependency: dependency,
|
dependency: dependency,
|
||||||
managedObjectContext: statusFetchedResultsController.fetchedResultsController.managedObjectContext,
|
managedObjectContext: statusFetchedResultsController.fetchedResultsController.managedObjectContext,
|
||||||
timestampUpdatePublisher: timestampUpdatePublisher,
|
|
||||||
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: nil,
|
timelineMiddleLoaderTableViewCellDelegate: nil,
|
||||||
threadReplyLoaderTableViewCellDelegate: nil
|
threadReplyLoaderTableViewCellDelegate: nil
|
||||||
|
|
|
@ -97,7 +97,7 @@ final class ProfileViewController: UIViewController, NeedsDependency, MediaPrevi
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
os_log("%{public}s[%{public}ld], %{public}s: deinit", ((#file as NSString).lastPathComponent), #line, #function)
|
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,17 +14,11 @@ extension UserTimelineViewModel {
|
||||||
dependency: NeedsDependency,
|
dependency: NeedsDependency,
|
||||||
statusTableViewCellDelegate: StatusTableViewCellDelegate
|
statusTableViewCellDelegate: StatusTableViewCellDelegate
|
||||||
) {
|
) {
|
||||||
let timestampUpdatePublisher = Timer.publish(every: 1.0, on: .main, in: .common)
|
|
||||||
.autoconnect()
|
|
||||||
.share()
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
|
|
||||||
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
||||||
for: tableView,
|
for: tableView,
|
||||||
timelineContext: .account,
|
timelineContext: .account,
|
||||||
dependency: dependency,
|
dependency: dependency,
|
||||||
managedObjectContext: statusFetchedResultsController.fetchedResultsController.managedObjectContext,
|
managedObjectContext: statusFetchedResultsController.fetchedResultsController.managedObjectContext,
|
||||||
timestampUpdatePublisher: timestampUpdatePublisher,
|
|
||||||
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: nil,
|
timelineMiddleLoaderTableViewCellDelegate: nil,
|
||||||
threadReplyLoaderTableViewCellDelegate: nil
|
threadReplyLoaderTableViewCellDelegate: nil
|
||||||
|
|
|
@ -17,17 +17,11 @@ extension PublicTimelineViewModel {
|
||||||
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: TimelineMiddleLoaderTableViewCellDelegate
|
timelineMiddleLoaderTableViewCellDelegate: TimelineMiddleLoaderTableViewCellDelegate
|
||||||
) {
|
) {
|
||||||
let timestampUpdatePublisher = Timer.publish(every: 1.0, on: .main, in: .common)
|
|
||||||
.autoconnect()
|
|
||||||
.share()
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
|
|
||||||
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
||||||
for: tableView,
|
for: tableView,
|
||||||
timelineContext: .public,
|
timelineContext: .public,
|
||||||
dependency: dependency,
|
dependency: dependency,
|
||||||
managedObjectContext: fetchedResultsController.managedObjectContext,
|
managedObjectContext: fetchedResultsController.managedObjectContext,
|
||||||
timestampUpdatePublisher: timestampUpdatePublisher,
|
|
||||||
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: timelineMiddleLoaderTableViewCellDelegate,
|
timelineMiddleLoaderTableViewCellDelegate: timelineMiddleLoaderTableViewCellDelegate,
|
||||||
threadReplyLoaderTableViewCellDelegate: nil
|
threadReplyLoaderTableViewCellDelegate: nil
|
||||||
|
|
|
@ -94,6 +94,10 @@ final class SearchViewController: UIViewController, NeedsDependency {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
let searchBarTapPublisher = PassthroughSubject<Void, Never>()
|
let searchBarTapPublisher = PassthroughSubject<Void, Never>()
|
||||||
|
|
||||||
|
deinit {
|
||||||
|
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,10 @@ final class StatusTableViewCell: UITableViewCell, StatusCell {
|
||||||
_init()
|
_init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deinit {
|
||||||
|
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension StatusTableViewCell {
|
extension StatusTableViewCell {
|
||||||
|
|
|
@ -19,17 +19,11 @@ extension ThreadViewModel {
|
||||||
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
statusTableViewCellDelegate: StatusTableViewCellDelegate,
|
||||||
threadReplyLoaderTableViewCellDelegate: ThreadReplyLoaderTableViewCellDelegate
|
threadReplyLoaderTableViewCellDelegate: ThreadReplyLoaderTableViewCellDelegate
|
||||||
) {
|
) {
|
||||||
let timestampUpdatePublisher = Timer.publish(every: 1.0, on: .main, in: .common)
|
|
||||||
.autoconnect()
|
|
||||||
.share()
|
|
||||||
.eraseToAnyPublisher()
|
|
||||||
|
|
||||||
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
diffableDataSource = StatusSection.tableViewDiffableDataSource(
|
||||||
for: tableView,
|
for: tableView,
|
||||||
timelineContext: .thread,
|
timelineContext: .thread,
|
||||||
dependency: dependency,
|
dependency: dependency,
|
||||||
managedObjectContext: context.managedObjectContext,
|
managedObjectContext: context.managedObjectContext,
|
||||||
timestampUpdatePublisher: timestampUpdatePublisher,
|
|
||||||
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
statusTableViewCellDelegate: statusTableViewCellDelegate,
|
||||||
timelineMiddleLoaderTableViewCellDelegate: nil,
|
timelineMiddleLoaderTableViewCellDelegate: nil,
|
||||||
threadReplyLoaderTableViewCellDelegate: threadReplyLoaderTableViewCellDelegate
|
threadReplyLoaderTableViewCellDelegate: threadReplyLoaderTableViewCellDelegate
|
||||||
|
|
Loading…
Reference in New Issue