Minor refactoring (IOS-272)
Use an extension instead of its own class
This commit is contained in:
parent
ef666be391
commit
575b0c08ee
|
@ -365,7 +365,7 @@
|
||||||
DB6D9F3526351B7A008423CD /* NotificationService+Decrypt.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB6D9F3426351B7A008423CD /* NotificationService+Decrypt.swift */; };
|
DB6D9F3526351B7A008423CD /* NotificationService+Decrypt.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB6D9F3426351B7A008423CD /* NotificationService+Decrypt.swift */; };
|
||||||
DB72601C25E36A2100235243 /* MastodonServerRulesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB72601B25E36A2100235243 /* MastodonServerRulesViewController.swift */; };
|
DB72601C25E36A2100235243 /* MastodonServerRulesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB72601B25E36A2100235243 /* MastodonServerRulesViewController.swift */; };
|
||||||
DB72602725E36A6F00235243 /* MastodonServerRulesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB72602625E36A6F00235243 /* MastodonServerRulesViewModel.swift */; };
|
DB72602725E36A6F00235243 /* MastodonServerRulesViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB72602625E36A6F00235243 /* MastodonServerRulesViewModel.swift */; };
|
||||||
DB7274F4273BB9B200577D95 /* ListBatchFetchViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB7274F3273BB9B200577D95 /* ListBatchFetchViewModel.swift */; };
|
DB7274F4273BB9B200577D95 /* UIScrollViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB7274F3273BB9B200577D95 /* UIScrollViewDelegate.swift */; };
|
||||||
DB73B490261F030A002E9E9F /* SafariActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB73B48F261F030A002E9E9F /* SafariActivity.swift */; };
|
DB73B490261F030A002E9E9F /* SafariActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB73B48F261F030A002E9E9F /* SafariActivity.swift */; };
|
||||||
DB75BF1E263C1C1B00EDBF1F /* CustomScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB75BF1D263C1C1B00EDBF1F /* CustomScheduler.swift */; };
|
DB75BF1E263C1C1B00EDBF1F /* CustomScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB75BF1D263C1C1B00EDBF1F /* CustomScheduler.swift */; };
|
||||||
DB789A0B25F9F2950071ACA0 /* ComposeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB789A0A25F9F2950071ACA0 /* ComposeViewController.swift */; };
|
DB789A0B25F9F2950071ACA0 /* ComposeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB789A0A25F9F2950071ACA0 /* ComposeViewController.swift */; };
|
||||||
|
@ -1045,7 +1045,7 @@
|
||||||
DB6D9F3426351B7A008423CD /* NotificationService+Decrypt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationService+Decrypt.swift"; sourceTree = "<group>"; };
|
DB6D9F3426351B7A008423CD /* NotificationService+Decrypt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationService+Decrypt.swift"; sourceTree = "<group>"; };
|
||||||
DB72601B25E36A2100235243 /* MastodonServerRulesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MastodonServerRulesViewController.swift; sourceTree = "<group>"; };
|
DB72601B25E36A2100235243 /* MastodonServerRulesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MastodonServerRulesViewController.swift; sourceTree = "<group>"; };
|
||||||
DB72602625E36A6F00235243 /* MastodonServerRulesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MastodonServerRulesViewModel.swift; sourceTree = "<group>"; };
|
DB72602625E36A6F00235243 /* MastodonServerRulesViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MastodonServerRulesViewModel.swift; sourceTree = "<group>"; };
|
||||||
DB7274F3273BB9B200577D95 /* ListBatchFetchViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListBatchFetchViewModel.swift; sourceTree = "<group>"; };
|
DB7274F3273BB9B200577D95 /* UIScrollViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIScrollViewDelegate.swift; sourceTree = "<group>"; };
|
||||||
DB73B48F261F030A002E9E9F /* SafariActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariActivity.swift; sourceTree = "<group>"; };
|
DB73B48F261F030A002E9E9F /* SafariActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariActivity.swift; sourceTree = "<group>"; };
|
||||||
DB75BF1D263C1C1B00EDBF1F /* CustomScheduler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomScheduler.swift; sourceTree = "<group>"; };
|
DB75BF1D263C1C1B00EDBF1F /* CustomScheduler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomScheduler.swift; sourceTree = "<group>"; };
|
||||||
DB789A0A25F9F2950071ACA0 /* ComposeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposeViewController.swift; sourceTree = "<group>"; };
|
DB789A0A25F9F2950071ACA0 /* ComposeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposeViewController.swift; sourceTree = "<group>"; };
|
||||||
|
@ -2524,27 +2524,28 @@
|
||||||
children = (
|
children = (
|
||||||
2A82294E29262EE000D2A1F7 /* AppContext+NextAccount.swift */,
|
2A82294E29262EE000D2A1F7 /* AppContext+NextAccount.swift */,
|
||||||
5DF1056325F887CB00D6C0D4 /* AVPlayer.swift */,
|
5DF1056325F887CB00D6C0D4 /* AVPlayer.swift */,
|
||||||
|
2A1FE47D2938C11200784BF1 /* Collection+IsNotEmpty.swift */,
|
||||||
2D206B8525F5FB0900143C56 /* Double.swift */,
|
2D206B8525F5FB0900143C56 /* Double.swift */,
|
||||||
DBB3BA2926A81C020004F2D4 /* FLAnimatedImageView.swift */,
|
DBB3BA2926A81C020004F2D4 /* FLAnimatedImageView.swift */,
|
||||||
DB68586325E619B700F0A850 /* NSKeyValueObservation.swift */,
|
DB68586325E619B700F0A850 /* NSKeyValueObservation.swift */,
|
||||||
2D939AB425EDD8A90076FA61 /* String.swift */,
|
2D939AB425EDD8A90076FA61 /* String.swift */,
|
||||||
DB68A06225E905E000CFDF14 /* UIApplication.swift */,
|
|
||||||
DB45FAB525CA5485005A8AC7 /* UIAlertController.swift */,
|
DB45FAB525CA5485005A8AC7 /* UIAlertController.swift */,
|
||||||
|
DB68A06225E905E000CFDF14 /* UIApplication.swift */,
|
||||||
DB45FAD625CA6C76005A8AC7 /* UIBarButtonItem.swift */,
|
DB45FAD625CA6C76005A8AC7 /* UIBarButtonItem.swift */,
|
||||||
|
2D206B9125F60EA700143C56 /* UIControl.swift */,
|
||||||
|
0FAA101B25E10E760017CCDE /* UIFont.swift */,
|
||||||
|
2AE244472927831100BDBF7C /* UIImage+SFSymbols.swift */,
|
||||||
|
855149C7295F1C5F00943D96 /* UIInterfaceOrientationMask.swift */,
|
||||||
|
DB9E0D6E25EE008500CFDD76 /* UIInterpolatingMotionEffect.swift */,
|
||||||
|
2D84350425FF858100EECE90 /* UIScrollView.swift */,
|
||||||
|
DB7274F3273BB9B200577D95 /* UIScrollViewDelegate.swift */,
|
||||||
|
DBCC3B2F261440A50045B23D /* UITabBarController.swift */,
|
||||||
DB4481B825EE289600BEFB67 /* UITableView.swift */,
|
DB4481B825EE289600BEFB67 /* UITableView.swift */,
|
||||||
DBD376B1269302A4007FEC24 /* UITableViewCell.swift */,
|
DBD376B1269302A4007FEC24 /* UITableViewCell.swift */,
|
||||||
0FAA101B25E10E760017CCDE /* UIFont.swift */,
|
|
||||||
2D206B9125F60EA700143C56 /* UIControl.swift */,
|
|
||||||
5DA732CB2629CEF500A92342 /* UIView+Remove.swift */,
|
|
||||||
2D24E1222626ED9D00A59D4F /* UIView+Gesture.swift */,
|
|
||||||
DB8AF55C25C138B7002E6C99 /* UIViewController.swift */,
|
|
||||||
2D3F9E0325DFA133004262D9 /* UITapGestureRecognizer.swift */,
|
2D3F9E0325DFA133004262D9 /* UITapGestureRecognizer.swift */,
|
||||||
2D84350425FF858100EECE90 /* UIScrollView.swift */,
|
2D24E1222626ED9D00A59D4F /* UIView+Gesture.swift */,
|
||||||
DB9E0D6E25EE008500CFDD76 /* UIInterpolatingMotionEffect.swift */,
|
5DA732CB2629CEF500A92342 /* UIView+Remove.swift */,
|
||||||
2AE244472927831100BDBF7C /* UIImage+SFSymbols.swift */,
|
DB8AF55C25C138B7002E6C99 /* UIViewController.swift */,
|
||||||
DBCC3B2F261440A50045B23D /* UITabBarController.swift */,
|
|
||||||
2A1FE47D2938C11200784BF1 /* Collection+IsNotEmpty.swift */,
|
|
||||||
855149C7295F1C5F00943D96 /* UIInterfaceOrientationMask.swift */,
|
|
||||||
);
|
);
|
||||||
path = Extension;
|
path = Extension;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -2676,7 +2677,6 @@
|
||||||
DB9D6C2025E502C60051B173 /* ViewModel */ = {
|
DB9D6C2025E502C60051B173 /* ViewModel */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
DB7274F3273BB9B200577D95 /* ListBatchFetchViewModel.swift */,
|
|
||||||
);
|
);
|
||||||
path = ViewModel;
|
path = ViewModel;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
@ -3663,7 +3663,7 @@
|
||||||
DBB45B5927B39FE4002DC5A7 /* MediaPreviewVideoViewModel.swift in Sources */,
|
DBB45B5927B39FE4002DC5A7 /* MediaPreviewVideoViewModel.swift in Sources */,
|
||||||
DB0FCB76279571C5006C02E2 /* ThreadViewController+DataSourceProvider.swift in Sources */,
|
DB0FCB76279571C5006C02E2 /* ThreadViewController+DataSourceProvider.swift in Sources */,
|
||||||
DB1E346825F518E20079D7DF /* CategoryPickerSection.swift in Sources */,
|
DB1E346825F518E20079D7DF /* CategoryPickerSection.swift in Sources */,
|
||||||
DB7274F4273BB9B200577D95 /* ListBatchFetchViewModel.swift in Sources */,
|
DB7274F4273BB9B200577D95 /* UIScrollViewDelegate.swift in Sources */,
|
||||||
DB0618052785A73D0030EE79 /* RegisterItem.swift in Sources */,
|
DB0618052785A73D0030EE79 /* RegisterItem.swift in Sources */,
|
||||||
DB6B74EF272FB55000C70B6E /* FollowerListViewController.swift in Sources */,
|
DB6B74EF272FB55000C70B6E /* FollowerListViewController.swift in Sources */,
|
||||||
DB4AA6B327BA34B6009EC082 /* CellFrameCacheContainer.swift in Sources */,
|
DB4AA6B327BA34B6009EC082 /* CellFrameCacheContainer.swift in Sources */,
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
//
|
// Copyright © 2024 Mastodon gGmbH. All rights reserved.
|
||||||
// ListBatchFetchViewModel.swift
|
|
||||||
// Mastodon
|
|
||||||
//
|
|
||||||
// Created by Cirno MainasuK on 2021-11-10.
|
|
||||||
//
|
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
final class ListBatchFetchViewModel {
|
extension UIScrollViewDelegate {
|
||||||
static func scrollViewDidScrollToEnd(_ scrollView: UIScrollView, action: () -> Void) {
|
static func scrollViewDidScrollToEnd(_ scrollView: UIScrollView, action: () -> Void) {
|
||||||
if scrollView.isDragging || scrollView.isTracking { return }
|
if scrollView.isDragging || scrollView.isTracking { return }
|
||||||
|
|
|
@ -199,7 +199,7 @@ extension DiscoveryNewsViewController: TableViewControllerNavigateable {
|
||||||
|
|
||||||
extension DiscoveryNewsViewController: UIScrollViewDelegate {
|
extension DiscoveryNewsViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(DiscoveryNewsViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(DiscoveryNewsViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ final class DiscoveryNewsViewModel {
|
||||||
// input
|
// input
|
||||||
let context: AppContext
|
let context: AppContext
|
||||||
let authContext: AuthContext
|
let authContext: AuthContext
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
|
|
||||||
// output
|
// output
|
||||||
@Published var links: [Mastodon.Entity.Link] = []
|
@Published var links: [Mastodon.Entity.Link] = []
|
||||||
|
|
|
@ -165,7 +165,7 @@ extension DiscoveryPostsViewController: StatusTableViewControllerNavigateable {
|
||||||
|
|
||||||
extension DiscoveryPostsViewController: UIScrollViewDelegate {
|
extension DiscoveryPostsViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(DiscoveryPostsViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(DiscoveryPostsViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ final class DiscoveryPostsViewModel {
|
||||||
let context: AppContext
|
let context: AppContext
|
||||||
let authContext: AuthContext
|
let authContext: AuthContext
|
||||||
let dataController: StatusDataController
|
let dataController: StatusDataController
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
|
|
||||||
// output
|
// output
|
||||||
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
||||||
|
|
|
@ -252,7 +252,7 @@ extension HashtagTimelineViewController: StatusTableViewControllerNavigateable {
|
||||||
|
|
||||||
extension HashtagTimelineViewController: UIScrollViewDelegate {
|
extension HashtagTimelineViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(HashtagTimelineViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(HashtagTimelineViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ final class HashtagTimelineViewModel {
|
||||||
let isFetchingLatestTimeline = CurrentValueSubject<Bool, Never>(false)
|
let isFetchingLatestTimeline = CurrentValueSubject<Bool, Never>(false)
|
||||||
let timelinePredicate = CurrentValueSubject<NSPredicate?, Never>(nil)
|
let timelinePredicate = CurrentValueSubject<NSPredicate?, Never>(nil)
|
||||||
let hashtagEntity = CurrentValueSubject<Mastodon.Entity.Tag?, Never>(nil)
|
let hashtagEntity = CurrentValueSubject<Mastodon.Entity.Tag?, Never>(nil)
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
|
|
||||||
// output
|
// output
|
||||||
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
||||||
|
|
|
@ -25,7 +25,6 @@ final class HomeTimelineViewModel: NSObject {
|
||||||
let context: AppContext
|
let context: AppContext
|
||||||
let authContext: AuthContext
|
let authContext: AuthContext
|
||||||
let dataController: FeedDataController
|
let dataController: FeedDataController
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
|
|
||||||
var presentedSuggestions = false
|
var presentedSuggestions = false
|
||||||
|
|
||||||
|
|
|
@ -301,7 +301,7 @@ extension NotificationTimelineViewController: TableViewControllerNavigateable {
|
||||||
|
|
||||||
extension NotificationTimelineViewController: UIScrollViewDelegate {
|
extension NotificationTimelineViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.loadOldestStateMachine.enter(NotificationTimelineViewModel.LoadOldestState.Loading.self)
|
viewModel.loadOldestStateMachine.enter(NotificationTimelineViewModel.LoadOldestState.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ final class NotificationTimelineViewModel {
|
||||||
let authContext: AuthContext
|
let authContext: AuthContext
|
||||||
let scope: Scope
|
let scope: Scope
|
||||||
let dataController: FeedDataController
|
let dataController: FeedDataController
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
@Published var isLoadingLatest = false
|
@Published var isLoadingLatest = false
|
||||||
@Published var lastAutomaticFetchTimestamp: Date?
|
@Published var lastAutomaticFetchTimestamp: Date?
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ extension BookmarkViewController: StatusTableViewControllerNavigateable {
|
||||||
|
|
||||||
extension BookmarkViewController: UIScrollViewDelegate {
|
extension BookmarkViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
print("See me loading \(Date())")
|
print("See me loading \(Date())")
|
||||||
viewModel.stateMachine.enter(BookmarkViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(BookmarkViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ final class BookmarkViewModel {
|
||||||
let authContext: AuthContext
|
let authContext: AuthContext
|
||||||
|
|
||||||
let dataController: StatusDataController
|
let dataController: StatusDataController
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
|
|
||||||
// output
|
// output
|
||||||
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
||||||
|
|
|
@ -136,7 +136,7 @@ extension FavoriteViewController: StatusTableViewControllerNavigateable {
|
||||||
|
|
||||||
extension FavoriteViewController: UIScrollViewDelegate {
|
extension FavoriteViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(FavoriteViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(FavoriteViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ final class FavoriteViewModel {
|
||||||
let context: AppContext
|
let context: AppContext
|
||||||
let authContext: AuthContext
|
let authContext: AuthContext
|
||||||
let dataController: StatusDataController
|
let dataController: StatusDataController
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
|
|
||||||
// output
|
// output
|
||||||
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
var diffableDataSource: UITableViewDiffableDataSource<StatusSection, StatusItem>?
|
||||||
|
|
|
@ -159,7 +159,7 @@ extension FollowerListViewController: DataSourceProvider {
|
||||||
|
|
||||||
extension FollowerListViewController: UIScrollViewDelegate {
|
extension FollowerListViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(FollowerListViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(FollowerListViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,7 @@ extension UserTimelineViewController: IndicatorInfoProvider {
|
||||||
//MARK: - UIScrollViewDelegate
|
//MARK: - UIScrollViewDelegate
|
||||||
extension UserTimelineViewController: UIScrollViewDelegate {
|
extension UserTimelineViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
|
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(UserTimelineViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(UserTimelineViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,6 @@ final class UserTimelineViewModel {
|
||||||
let authContext: AuthContext
|
let authContext: AuthContext
|
||||||
let title: String
|
let title: String
|
||||||
let dataController: StatusDataController
|
let dataController: StatusDataController
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
@Published var userIdentifier: UserIdentifier?
|
@Published var userIdentifier: UserIdentifier?
|
||||||
@Published var queryFilter: QueryFilter
|
@Published var queryFilter: QueryFilter
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ extension FavoritedByViewController: UserTableViewCellDelegate {}
|
||||||
|
|
||||||
extension FavoritedByViewController: UIScrollViewDelegate {
|
extension FavoritedByViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(UserListViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(UserListViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ extension RebloggedByViewController: UserTableViewCellDelegate {}
|
||||||
|
|
||||||
extension RebloggedByViewController: UIScrollViewDelegate {
|
extension RebloggedByViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(UserListViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(UserListViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ final class UserListViewModel {
|
||||||
let kind: Kind
|
let kind: Kind
|
||||||
@Published var accounts: [Mastodon.Entity.Account]
|
@Published var accounts: [Mastodon.Entity.Account]
|
||||||
@Published var relationships: [Mastodon.Entity.Relationship]
|
@Published var relationships: [Mastodon.Entity.Relationship]
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
|
|
||||||
// output
|
// output
|
||||||
var diffableDataSource: UITableViewDiffableDataSource<UserSection, UserItem>!
|
var diffableDataSource: UITableViewDiffableDataSource<UserSection, UserItem>!
|
||||||
|
|
|
@ -191,7 +191,7 @@ extension ReportStatusViewController: UIAdaptivePresentationControllerDelegate {
|
||||||
|
|
||||||
extension ReportStatusViewController: UIScrollViewDelegate {
|
extension ReportStatusViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(ReportStatusViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(ReportStatusViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@ class ReportStatusViewModel {
|
||||||
let account: Mastodon.Entity.Account
|
let account: Mastodon.Entity.Account
|
||||||
let status: MastodonStatus?
|
let status: MastodonStatus?
|
||||||
let dataController: StatusDataController
|
let dataController: StatusDataController
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
|
|
||||||
@Published var isSkip = false
|
@Published var isSkip = false
|
||||||
@Published var selectStatuses = OrderedSet<MastodonStatus>()
|
@Published var selectStatuses = OrderedSet<MastodonStatus>()
|
||||||
|
|
|
@ -98,7 +98,7 @@ extension SearchResultViewController: UserTableViewCellDelegate {}
|
||||||
|
|
||||||
extension SearchResultViewController: UIScrollViewDelegate {
|
extension SearchResultViewController: UIScrollViewDelegate {
|
||||||
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
func scrollViewDidScroll(_ scrollView: UIScrollView) {
|
||||||
ListBatchFetchViewModel.scrollViewDidScrollToEnd(scrollView) {
|
Self.scrollViewDidScrollToEnd(scrollView) {
|
||||||
viewModel.stateMachine.enter(SearchResultViewModel.State.Loading.self)
|
viewModel.stateMachine.enter(SearchResultViewModel.State.Loading.self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,6 @@ final class SearchResultViewModel {
|
||||||
@Published var accounts: [Mastodon.Entity.Account] = []
|
@Published var accounts: [Mastodon.Entity.Account] = []
|
||||||
var relationships: [Mastodon.Entity.Relationship] = []
|
var relationships: [Mastodon.Entity.Relationship] = []
|
||||||
let dataController: StatusDataController
|
let dataController: StatusDataController
|
||||||
let listBatchFetchViewModel = ListBatchFetchViewModel()
|
|
||||||
|
|
||||||
var cellFrameCache = NSCache<NSNumber, NSValue>()
|
var cellFrameCache = NSCache<NSNumber, NSValue>()
|
||||||
var navigationBarFrame = CurrentValueSubject<CGRect, Never>(.zero)
|
var navigationBarFrame = CurrentValueSubject<CGRect, Never>(.zero)
|
||||||
|
|
Loading…
Reference in New Issue