[WIP] Remove Core Data from Suggested Accounts/Familiar Followers (IOS-194)

This commit is contained in:
Nathan Mattes 2023-11-17 14:48:23 +01:00
parent 1fabe5f776
commit 4b298f6bd8
14 changed files with 155 additions and 179 deletions

View File

@ -137,6 +137,11 @@
D81A22752AB4643200905D71 /* SearchResultsOverviewTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A22742AB4643200905D71 /* SearchResultsOverviewTableViewController.swift */; }; D81A22752AB4643200905D71 /* SearchResultsOverviewTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A22742AB4643200905D71 /* SearchResultsOverviewTableViewController.swift */; };
D81A22782AB4782400905D71 /* SearchResultOverviewSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A22772AB4782400905D71 /* SearchResultOverviewSection.swift */; }; D81A22782AB4782400905D71 /* SearchResultOverviewSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A22772AB4782400905D71 /* SearchResultOverviewSection.swift */; };
D81A227B2AB47B9A00905D71 /* SearchResultDefaultSectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A227A2AB47B9A00905D71 /* SearchResultDefaultSectionTableViewCell.swift */; }; D81A227B2AB47B9A00905D71 /* SearchResultDefaultSectionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A227A2AB47B9A00905D71 /* SearchResultDefaultSectionTableViewCell.swift */; };
D81A94122B07A1BE0067A19D /* ProfileCardTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A94112B07A1BE0067A19D /* ProfileCardTableViewCell.swift */; };
D81A94132B07A1BE0067A19D /* ProfileCardTableViewCell+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A94102B07A1BE0067A19D /* ProfileCardTableViewCell+Configuration.swift */; };
D81A94172B07A1D30067A19D /* ProfileCardView+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A94162B07A1D30067A19D /* ProfileCardView+Configuration.swift */; };
D81A94182B07A1D30067A19D /* ProfileCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A94142B07A1D30067A19D /* ProfileCardView.swift */; };
D81A94192B07A1D30067A19D /* ProfileCardView+ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81A94152B07A1D30067A19D /* ProfileCardView+ViewModel.swift */; };
D81D12462A4E1861005009D4 /* PolicySelectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81D12452A4E1861005009D4 /* PolicySelectionViewController.swift */; }; D81D12462A4E1861005009D4 /* PolicySelectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81D12452A4E1861005009D4 /* PolicySelectionViewController.swift */; };
D81D124B2A4E1914005009D4 /* ToggleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81D124A2A4E1914005009D4 /* ToggleTableViewCell.swift */; }; D81D124B2A4E1914005009D4 /* ToggleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81D124A2A4E1914005009D4 /* ToggleTableViewCell.swift */; };
D82BD7532ABC44C2009A374A /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F9170E2A4B47EF008A5370 /* Coordinator.swift */; }; D82BD7532ABC44C2009A374A /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8F9170E2A4B47EF008A5370 /* Coordinator.swift */; };
@ -451,7 +456,6 @@
DBCBCBF4267CB070000F5B51 /* Decode85.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCBCBF3267CB070000F5B51 /* Decode85.swift */; }; DBCBCBF4267CB070000F5B51 /* Decode85.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCBCBF3267CB070000F5B51 /* Decode85.swift */; };
DBCBED1726132DB500B49291 /* UserTimelineViewModel+Diffable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCBED1626132DB500B49291 /* UserTimelineViewModel+Diffable.swift */; }; DBCBED1726132DB500B49291 /* UserTimelineViewModel+Diffable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCBED1626132DB500B49291 /* UserTimelineViewModel+Diffable.swift */; };
DBCC3B30261440A50045B23D /* UITabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCC3B2F261440A50045B23D /* UITabBarController.swift */; }; DBCC3B30261440A50045B23D /* UITabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCC3B2F261440A50045B23D /* UITabBarController.swift */; };
DBCC3B8F26148F7B0045B23D /* CachedProfileViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCC3B8E26148F7B0045B23D /* CachedProfileViewModel.swift */; };
DBD376B2269302A4007FEC24 /* UITableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD376B1269302A4007FEC24 /* UITableViewCell.swift */; }; DBD376B2269302A4007FEC24 /* UITableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD376B1269302A4007FEC24 /* UITableViewCell.swift */; };
DBD5B1F827BCFD9D00BD6B38 /* DataSourceProvider+TableViewControllerNavigateable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD5B1F727BCFD9D00BD6B38 /* DataSourceProvider+TableViewControllerNavigateable.swift */; }; DBD5B1F827BCFD9D00BD6B38 /* DataSourceProvider+TableViewControllerNavigateable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD5B1F727BCFD9D00BD6B38 /* DataSourceProvider+TableViewControllerNavigateable.swift */; };
DBD5B1FA27BD013700BD6B38 /* DataSourceProvider+StatusTableViewControllerNavigateable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD5B1F927BD013700BD6B38 /* DataSourceProvider+StatusTableViewControllerNavigateable.swift */; }; DBD5B1FA27BD013700BD6B38 /* DataSourceProvider+StatusTableViewControllerNavigateable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD5B1F927BD013700BD6B38 /* DataSourceProvider+StatusTableViewControllerNavigateable.swift */; };
@ -794,6 +798,11 @@
D81A940D2B04E7AC0067A19D /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = hy.lproj/LaunchScreen.strings; sourceTree = "<group>"; }; D81A940D2B04E7AC0067A19D /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = hy.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
D81A940E2B04E7AD0067A19D /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = hy.lproj/MainInterface.strings; sourceTree = "<group>"; }; D81A940E2B04E7AD0067A19D /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = hy.lproj/MainInterface.strings; sourceTree = "<group>"; };
D81A940F2B04E7AD0067A19D /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = hy.lproj/InfoPlist.strings; sourceTree = "<group>"; }; D81A940F2B04E7AD0067A19D /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = hy.lproj/InfoPlist.strings; sourceTree = "<group>"; };
D81A94102B07A1BE0067A19D /* ProfileCardTableViewCell+Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ProfileCardTableViewCell+Configuration.swift"; sourceTree = "<group>"; };
D81A94112B07A1BE0067A19D /* ProfileCardTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileCardTableViewCell.swift; sourceTree = "<group>"; };
D81A94142B07A1D30067A19D /* ProfileCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileCardView.swift; sourceTree = "<group>"; };
D81A94152B07A1D30067A19D /* ProfileCardView+ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ProfileCardView+ViewModel.swift"; sourceTree = "<group>"; };
D81A94162B07A1D30067A19D /* ProfileCardView+Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ProfileCardView+Configuration.swift"; sourceTree = "<group>"; };
D81D12452A4E1861005009D4 /* PolicySelectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolicySelectionViewController.swift; sourceTree = "<group>"; }; D81D12452A4E1861005009D4 /* PolicySelectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PolicySelectionViewController.swift; sourceTree = "<group>"; };
D81D124A2A4E1914005009D4 /* ToggleTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleTableViewCell.swift; sourceTree = "<group>"; }; D81D124A2A4E1914005009D4 /* ToggleTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleTableViewCell.swift; sourceTree = "<group>"; };
D82463522A52B47B00A3DBDD /* be */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = be; path = be.lproj/Intents.strings; sourceTree = "<group>"; }; D82463522A52B47B00A3DBDD /* be */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = be; path = be.lproj/Intents.strings; sourceTree = "<group>"; };
@ -1194,7 +1203,6 @@
DBCBCBF3267CB070000F5B51 /* Decode85.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Decode85.swift; sourceTree = "<group>"; }; DBCBCBF3267CB070000F5B51 /* Decode85.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Decode85.swift; sourceTree = "<group>"; };
DBCBED1626132DB500B49291 /* UserTimelineViewModel+Diffable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserTimelineViewModel+Diffable.swift"; sourceTree = "<group>"; }; DBCBED1626132DB500B49291 /* UserTimelineViewModel+Diffable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserTimelineViewModel+Diffable.swift"; sourceTree = "<group>"; };
DBCC3B2F261440A50045B23D /* UITabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITabBarController.swift; sourceTree = "<group>"; }; DBCC3B2F261440A50045B23D /* UITabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITabBarController.swift; sourceTree = "<group>"; };
DBCC3B8E26148F7B0045B23D /* CachedProfileViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CachedProfileViewModel.swift; sourceTree = "<group>"; };
DBD376B1269302A4007FEC24 /* UITableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITableViewCell.swift; sourceTree = "<group>"; }; DBD376B1269302A4007FEC24 /* UITableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITableViewCell.swift; sourceTree = "<group>"; };
DBD5B1F727BCFD9D00BD6B38 /* DataSourceProvider+TableViewControllerNavigateable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DataSourceProvider+TableViewControllerNavigateable.swift"; sourceTree = "<group>"; }; DBD5B1F727BCFD9D00BD6B38 /* DataSourceProvider+TableViewControllerNavigateable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DataSourceProvider+TableViewControllerNavigateable.swift"; sourceTree = "<group>"; };
DBD5B1F927BD013700BD6B38 /* DataSourceProvider+StatusTableViewControllerNavigateable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DataSourceProvider+StatusTableViewControllerNavigateable.swift"; sourceTree = "<group>"; }; DBD5B1F927BD013700BD6B38 /* DataSourceProvider+StatusTableViewControllerNavigateable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DataSourceProvider+StatusTableViewControllerNavigateable.swift"; sourceTree = "<group>"; };
@ -2094,8 +2102,6 @@
DB3E6FE52806A5BA00B035AE /* Discovery */ = { DB3E6FE52806A5BA00B035AE /* Discovery */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
DB3E6FE32806A5B800B035AE /* DiscoverySection.swift */,
DB3E6FE62806A7A200B035AE /* DiscoveryItem.swift */,
); );
path = Discovery; path = Discovery;
sourceTree = "<group>"; sourceTree = "<group>";
@ -2114,6 +2120,11 @@
DB3E6FF62807C40500B035AE /* ForYou */ = { DB3E6FF62807C40500B035AE /* ForYou */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D81A94142B07A1D30067A19D /* ProfileCardView.swift */,
D81A94162B07A1D30067A19D /* ProfileCardView+Configuration.swift */,
D81A94152B07A1D30067A19D /* ProfileCardView+ViewModel.swift */,
D81A94112B07A1BE0067A19D /* ProfileCardTableViewCell.swift */,
D81A94102B07A1BE0067A19D /* ProfileCardTableViewCell+Configuration.swift */,
DB3E6FF42807C40300B035AE /* DiscoveryForYouViewController.swift */, DB3E6FF42807C40300B035AE /* DiscoveryForYouViewController.swift */,
DB3E6FF72807C45300B035AE /* DiscoveryForYouViewModel.swift */, DB3E6FF72807C45300B035AE /* DiscoveryForYouViewModel.swift */,
DB3E6FF92807C47900B035AE /* DiscoveryForYouViewModel+Diffable.swift */, DB3E6FF92807C47900B035AE /* DiscoveryForYouViewModel+Diffable.swift */,
@ -2763,7 +2774,6 @@
DBFEEC97279BDC6A004F81DD /* About */, DBFEEC97279BDC6A004F81DD /* About */,
DB9D6BFE25E4F5940051B173 /* ProfileViewController.swift */, DB9D6BFE25E4F5940051B173 /* ProfileViewController.swift */,
DBB5255D2611F07A002F1F29 /* ProfileViewModel.swift */, DBB5255D2611F07A002F1F29 /* ProfileViewModel.swift */,
DBCC3B8E26148F7B0045B23D /* CachedProfileViewModel.swift */,
DBAE3FAE26172FC0004B8251 /* RemoteProfileViewModel.swift */, DBAE3FAE26172FC0004B8251 /* RemoteProfileViewModel.swift */,
DBB525632612C988002F1F29 /* MeProfileViewModel.swift */, DBB525632612C988002F1F29 /* MeProfileViewModel.swift */,
); );
@ -2926,6 +2936,8 @@
DB3E6FED2806D7FC00B035AE /* News */, DB3E6FED2806D7FC00B035AE /* News */,
DB3EA8E7281B79E500598866 /* Community */, DB3EA8E7281B79E500598866 /* Community */,
DB3E6FF62807C40500B035AE /* ForYou */, DB3E6FF62807C40500B035AE /* ForYou */,
DB3E6FE32806A5B800B035AE /* DiscoverySection.swift */,
DB3E6FE62806A7A200B035AE /* DiscoveryItem.swift */,
DBDFF19928055A1400557A48 /* DiscoveryViewController.swift */, DBDFF19928055A1400557A48 /* DiscoveryViewController.swift */,
DBDFF19B28055BD600557A48 /* DiscoveryViewModel.swift */, DBDFF19B28055BD600557A48 /* DiscoveryViewModel.swift */,
); );
@ -3727,6 +3739,7 @@
2D38F1EB25CD477000561493 /* HomeTimelineViewModel+LoadLatestState.swift in Sources */, 2D38F1EB25CD477000561493 /* HomeTimelineViewModel+LoadLatestState.swift in Sources */,
DB5B7295273112B100081888 /* FollowingListViewController.swift in Sources */, DB5B7295273112B100081888 /* FollowingListViewController.swift in Sources */,
0F202201261326E6000C64BF /* HashtagTimelineViewModel.swift in Sources */, 0F202201261326E6000C64BF /* HashtagTimelineViewModel.swift in Sources */,
D81A94172B07A1D30067A19D /* ProfileCardView+Configuration.swift in Sources */,
DB63F7452799056400455B82 /* HashtagTableViewCell.swift in Sources */, DB63F7452799056400455B82 /* HashtagTableViewCell.swift in Sources */,
DBAE3FAF26172FC0004B8251 /* RemoteProfileViewModel.swift in Sources */, DBAE3FAF26172FC0004B8251 /* RemoteProfileViewModel.swift in Sources */,
D82BD7552ABC73AF009A374A /* NotificationPolicyTableViewCell.swift in Sources */, D82BD7552ABC73AF009A374A /* NotificationPolicyTableViewCell.swift in Sources */,
@ -3772,6 +3785,7 @@
2A506CF4292CD85800059C37 /* FollowedTagsViewController.swift in Sources */, 2A506CF4292CD85800059C37 /* FollowedTagsViewController.swift in Sources */,
DB1D843026566512000346B3 /* KeyboardPreference.swift in Sources */, DB1D843026566512000346B3 /* KeyboardPreference.swift in Sources */,
DB852D1926FAEB6B00FC9D81 /* SidebarViewController.swift in Sources */, DB852D1926FAEB6B00FC9D81 /* SidebarViewController.swift in Sources */,
D81A94132B07A1BE0067A19D /* ProfileCardTableViewCell+Configuration.swift in Sources */,
2D206B9225F60EA700143C56 /* UIControl.swift in Sources */, 2D206B9225F60EA700143C56 /* UIControl.swift in Sources */,
85904C02293BC0EB0011C817 /* ImageProvider.swift in Sources */, 85904C02293BC0EB0011C817 /* ImageProvider.swift in Sources */,
DBDFF1932805554900557A48 /* DiscoveryPostsViewModel.swift in Sources */, DBDFF1932805554900557A48 /* DiscoveryPostsViewModel.swift in Sources */,
@ -3799,6 +3813,7 @@
DB63F769279A5EBB00455B82 /* NotificationTimelineViewModel+Diffable.swift in Sources */, DB63F769279A5EBB00455B82 /* NotificationTimelineViewModel+Diffable.swift in Sources */,
DBFEEC9B279BDDD9004F81DD /* ProfileAboutViewModel+Diffable.swift in Sources */, DBFEEC9B279BDDD9004F81DD /* ProfileAboutViewModel+Diffable.swift in Sources */,
DBB525562611EDCA002F1F29 /* UserTimelineViewModel.swift in Sources */, DBB525562611EDCA002F1F29 /* UserTimelineViewModel.swift in Sources */,
D81A94192B07A1D30067A19D /* ProfileCardView+ViewModel.swift in Sources */,
D8916DC029211BE500124085 /* ContentSizedTableView.swift in Sources */, D8916DC029211BE500124085 /* ContentSizedTableView.swift in Sources */,
DB0618012785732C0030EE79 /* ServerRulesTableViewCell.swift in Sources */, DB0618012785732C0030EE79 /* ServerRulesTableViewCell.swift in Sources */,
DB98EB5C27B10A730082E365 /* ReportSupplementaryViewModel.swift in Sources */, DB98EB5C27B10A730082E365 /* ReportSupplementaryViewModel.swift in Sources */,
@ -3875,7 +3890,6 @@
2D38F20825CD491300561493 /* DisposeBagCollectable.swift in Sources */, 2D38F20825CD491300561493 /* DisposeBagCollectable.swift in Sources */,
D8F9170D2A4B3C6F008A5370 /* AboutMastodonTableViewCell.swift in Sources */, D8F9170D2A4B3C6F008A5370 /* AboutMastodonTableViewCell.swift in Sources */,
DB697DE1278F5296004EF2F7 /* DataSourceFacade+Model.swift in Sources */, DB697DE1278F5296004EF2F7 /* DataSourceFacade+Model.swift in Sources */,
DBCC3B8F26148F7B0045B23D /* CachedProfileViewModel.swift in Sources */,
DB4F097526A037F500D62E92 /* SearchHistoryViewModel.swift in Sources */, DB4F097526A037F500D62E92 /* SearchHistoryViewModel.swift in Sources */,
DB3EA8E9281B7A3700598866 /* DiscoveryCommunityViewModel.swift in Sources */, DB3EA8E9281B7A3700598866 /* DiscoveryCommunityViewModel.swift in Sources */,
D87BFC8B291D5C6B00FEE264 /* MastodonLoginView.swift in Sources */, D87BFC8B291D5C6B00FEE264 /* MastodonLoginView.swift in Sources */,
@ -3974,6 +3988,7 @@
DBEFCD7D282A2A3B00C0ABEA /* ReportServerRulesViewController.swift in Sources */, DBEFCD7D282A2A3B00C0ABEA /* ReportServerRulesViewController.swift in Sources */,
DBB525362611ECEB002F1F29 /* UserTimelineViewController.swift in Sources */, DBB525362611ECEB002F1F29 /* UserTimelineViewController.swift in Sources */,
D8F917122A4C6B67008A5370 /* GeneralSettingsViewController.swift in Sources */, D8F917122A4C6B67008A5370 /* GeneralSettingsViewController.swift in Sources */,
D81A94122B07A1BE0067A19D /* ProfileCardTableViewCell.swift in Sources */,
DB98EB4927B0F0CD0082E365 /* ReportStatusTableViewCell.swift in Sources */, DB98EB4927B0F0CD0082E365 /* ReportStatusTableViewCell.swift in Sources */,
855149CA29606D6400943D96 /* PortraitAlertController.swift in Sources */, 855149CA29606D6400943D96 /* PortraitAlertController.swift in Sources */,
DBF3B7412733EB9400E21627 /* MastodonLocalCode.swift in Sources */, DBF3B7412733EB9400E21627 /* MastodonLocalCode.swift in Sources */,
@ -3981,6 +3996,7 @@
DB4F096A269EDAD200D62E92 /* SearchResultViewModel+State.swift in Sources */, DB4F096A269EDAD200D62E92 /* SearchResultViewModel+State.swift in Sources */,
D8ECC8102AC31EA400AE0818 /* NotificationSettingsDisabledTableViewCell.swift in Sources */, D8ECC8102AC31EA400AE0818 /* NotificationSettingsDisabledTableViewCell.swift in Sources */,
5BB04FF5262F0E6D0043BFF6 /* ReportSection.swift in Sources */, 5BB04FF5262F0E6D0043BFF6 /* ReportSection.swift in Sources */,
D81A94182B07A1D30067A19D /* ProfileCardView.swift in Sources */,
DBEFCD82282A2AB100C0ABEA /* ReportServerRulesView.swift in Sources */, DBEFCD82282A2AB100C0ABEA /* ReportServerRulesView.swift in Sources */,
DBA94436265CBB7400C537E1 /* ProfileFieldItem.swift in Sources */, DBA94436265CBB7400C537E1 /* ProfileFieldItem.swift in Sources */,
2A3F6FE5292F6E44002E6DA7 /* FollowedTagsTableViewCell.swift in Sources */, 2A3F6FE5292F6E44002E6DA7 /* FollowedTagsTableViewCell.swift in Sources */,

View File

@ -42,10 +42,10 @@ extension DataSourceFacade {
return return
} }
let profileViewModel = CachedProfileViewModel( let profileViewModel = ProfileViewModel(
context: provider.context, context: provider.context,
authContext: provider.authContext, authContext: provider.authContext,
mastodonUser: user optionalMastodonUser: user
) )
_ = provider.coordinator.present( _ = provider.coordinator.present(
@ -125,7 +125,7 @@ extension DataSourceFacade {
let _user = provider.context.managedObjectContext.safeFetch(request).first let _user = provider.context.managedObjectContext.safeFetch(request).first
if let user = _user { if let user = _user {
return CachedProfileViewModel(context: provider.context, authContext: provider.authContext, mastodonUser: user) return ProfileViewModel(context: provider.context, authContext: provider.authContext, optionalMastodonUser: user)
} else { } else {
return RemoteProfileViewModel(context: provider.context, authContext: provider.authContext, userID: userID) return RemoteProfileViewModel(context: provider.context, authContext: provider.authContext, userID: userID)
} }

View File

@ -7,11 +7,10 @@
import Foundation import Foundation
import MastodonSDK import MastodonSDK
import CoreDataStack
enum DiscoveryItem: Hashable { enum DiscoveryItem: Hashable {
case hashtag(Mastodon.Entity.Tag) case hashtag(Mastodon.Entity.Tag)
case link(Mastodon.Entity.Link) case link(Mastodon.Entity.Link)
case user(ManagedObjectRecord<MastodonUser>) case account(Mastodon.Entity.Account)
case bottomLoader case bottomLoader
} }

View File

@ -55,19 +55,15 @@ extension DiscoverySection {
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: NewsTableViewCell.self), for: indexPath) as! NewsTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: NewsTableViewCell.self), for: indexPath) as! NewsTableViewCell
cell.newsView.configure(link: link) cell.newsView.configure(link: link)
return cell return cell
case .user(let record): case .account(let account):
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: ProfileCardTableViewCell.self), for: indexPath) as! ProfileCardTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: ProfileCardTableViewCell.self), for: indexPath) as! ProfileCardTableViewCell
context.managedObjectContext.performAndWait {
guard let user = record.object(in: context.managedObjectContext) else { return } cell.configure(tableView: tableView, account: account, profileCardTableViewCellDelegate: configuration.profileCardTableViewCellDelegate)
cell.configure(
tableView: tableView,
user: user,
profileCardTableViewCellDelegate: configuration.profileCardTableViewCellDelegate
)
// bind familiarFollowers // bind familiarFollowers
if let familiarFollowers = configuration.familiarFollowers { if let familiarFollowers = configuration.familiarFollowers {
familiarFollowers familiarFollowers
.map { array in array.first(where: { $0.id == user.id }) } .map { array in array.first(where: { $0.id == account.id }) }
.assign(to: \.familiarFollowers, on: cell.profileCardView.viewModel) .assign(to: \.familiarFollowers, on: cell.profileCardView.viewModel)
.store(in: &cell.disposeBag) .store(in: &cell.disposeBag)
} else { } else {
@ -75,7 +71,7 @@ extension DiscoverySection {
} }
// bind me // bind me
cell.profileCardView.viewModel.relationshipViewModel.me = configuration.authContext.mastodonAuthenticationBox.authentication.user(in: context.managedObjectContext) cell.profileCardView.viewModel.relationshipViewModel.me = configuration.authContext.mastodonAuthenticationBox.authentication.user(in: context.managedObjectContext)
} // }
return cell return cell
case .bottomLoader: case .bottomLoader:
let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: TimelineBottomLoaderTableViewCell.self), for: indexPath) as! TimelineBottomLoaderTableViewCell let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: TimelineBottomLoaderTableViewCell.self), for: indexPath) as! TimelineBottomLoaderTableViewCell

View File

@ -96,18 +96,11 @@ extension DiscoveryForYouViewController: AuthContextProvider {
extension DiscoveryForYouViewController: UITableViewDelegate { extension DiscoveryForYouViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard case let .user(record) = viewModel.diffableDataSource?.itemIdentifier(for: indexPath) else { return } guard case let .account(account) = viewModel.diffableDataSource?.itemIdentifier(for: indexPath) else { return }
guard let user = record.object(in: context.managedObjectContext) else { return }
let profileViewModel = CachedProfileViewModel( Task {
context: context, await DataSourceFacade.coordinateToProfileScene(provider: self, account: account)
authContext: viewModel.authContext, }
mastodonUser: user
)
_ = coordinator.present(
scene: .profile(viewModel: profileViewModel),
from: self,
transition: .show
)
} }
} }
@ -120,14 +113,11 @@ extension DiscoveryForYouViewController: ProfileCardTableViewCellDelegate {
relationshipButtonDidPressed button: ProfileRelationshipActionButton relationshipButtonDidPressed button: ProfileRelationshipActionButton
) { ) {
guard let indexPath = tableView.indexPath(for: cell) else { return } guard let indexPath = tableView.indexPath(for: cell) else { return }
guard case let .user(record) = viewModel.diffableDataSource?.itemIdentifier(for: indexPath) else { return } guard case let .account(account) = viewModel.diffableDataSource?.itemIdentifier(for: indexPath) else { return }
Task { Task {
try await DataSourceFacade.responseToUserFollowAction( try await DataSourceFacade.responseToUserFollowAction(dependency: self, user: account)
dependency: self, }
user: record
)
} // end Task
} }
func profileCardTableViewCell( func profileCardTableViewCell(
@ -136,10 +126,9 @@ extension DiscoveryForYouViewController: ProfileCardTableViewCellDelegate {
familiarFollowersDashboardViewDidPressed view: FamiliarFollowersDashboardView familiarFollowersDashboardViewDidPressed view: FamiliarFollowersDashboardView
) { ) {
guard let indexPath = tableView.indexPath(for: cell) else { return } guard let indexPath = tableView.indexPath(for: cell) else { return }
guard case let .user(record) = viewModel.diffableDataSource?.itemIdentifier(for: indexPath) else { return } guard case let .account(account) = viewModel.diffableDataSource?.itemIdentifier(for: indexPath) else { return }
guard let user = record.object(in: context.managedObjectContext) else { return }
let userID = user.id let userID = account.id
let _familiarFollowers = viewModel.familiarFollowers.first(where: { $0.id == userID }) let _familiarFollowers = viewModel.familiarFollowers.first(where: { $0.id == userID })
guard let familiarFollowers = _familiarFollowers else { guard let familiarFollowers = _familiarFollowers else {
assertionFailure() assertionFailure()

View File

@ -29,16 +29,16 @@ extension DiscoveryForYouViewModel {
try await fetch() try await fetch()
} }
userFetchedResultsController.$records $accounts
.receive(on: DispatchQueue.main) .receive(on: DispatchQueue.main)
.sink { [weak self] records in .sink { [weak self] accounts in
guard let self = self else { return } guard let self = self else { return }
guard let diffableDataSource = self.diffableDataSource else { return } guard let diffableDataSource = self.diffableDataSource else { return }
var snapshot = NSDiffableDataSourceSnapshot<DiscoverySection, DiscoveryItem>() var snapshot = NSDiffableDataSourceSnapshot<DiscoverySection, DiscoveryItem>()
snapshot.appendSections([.forYou]) snapshot.appendSections([.forYou])
let items = records.map { DiscoveryItem.user($0) } let items = accounts.map { DiscoveryItem.account($0) }
snapshot.appendItems(items, toSection: .forYou) snapshot.appendItems(items, toSection: .forYou)
diffableDataSource.apply(snapshot, animatingDifferences: false) diffableDataSource.apply(snapshot, animatingDifferences: false)

View File

@ -8,8 +8,6 @@
import UIKit import UIKit
import Combine import Combine
import GameplayKit import GameplayKit
import CoreData
import CoreDataStack
import MastodonSDK import MastodonSDK
import MastodonCore import MastodonCore
@ -20,11 +18,11 @@ final class DiscoveryForYouViewModel {
// input // input
let context: AppContext let context: AppContext
let authContext: AuthContext let authContext: AuthContext
let userFetchedResultsController: UserFetchedResultsController
@MainActor @MainActor
@Published var familiarFollowers: [Mastodon.Entity.FamiliarFollowers] = [] @Published var familiarFollowers: [Mastodon.Entity.FamiliarFollowers] = []
@Published var isFetching = false @Published var isFetching = false
@Published var accounts: [Mastodon.Entity.Account]
// output // output
var diffableDataSource: UITableViewDiffableDataSource<DiscoverySection, DiscoveryItem>? var diffableDataSource: UITableViewDiffableDataSource<DiscoverySection, DiscoveryItem>?
@ -33,12 +31,7 @@ final class DiscoveryForYouViewModel {
init(context: AppContext, authContext: AuthContext) { init(context: AppContext, authContext: AuthContext) {
self.context = context self.context = context
self.authContext = authContext self.authContext = authContext
self.userFetchedResultsController = UserFetchedResultsController( self.accounts = []
managedObjectContext: context.managedObjectContext,
domain: authContext.mastodonAuthenticationBox.domain,
additionalPredicate: nil
)
// end init
} }
} }
@ -46,40 +39,39 @@ extension DiscoveryForYouViewModel {
@MainActor @MainActor
func fetch() async throws { func fetch() async throws {
guard !isFetching else { return } guard isFetching == false else { return }
isFetching = true isFetching = true
defer { isFetching = false } defer { isFetching = false }
do { do {
let userIDs = try await fetchSuggestionAccounts() let suggestedAccounts = try await fetchSuggestionAccounts()
let _familiarFollowersResponse = try? await context.apiService.familiarFollowers( let familiarFollowersResponse = try? await context.apiService.familiarFollowers(
query: .init(ids: userIDs), query: .init(ids: suggestedAccounts.compactMap { $0.id }),
authenticationBox: authContext.mastodonAuthenticationBox authenticationBox: authContext.mastodonAuthenticationBox
) ).value
familiarFollowers = _familiarFollowersResponse?.value ?? [] familiarFollowers = familiarFollowersResponse ?? []
userFetchedResultsController.userIDs = userIDs accounts = suggestedAccounts
} catch { } catch {
// do nothing // do nothing
} }
} }
private func fetchSuggestionAccounts() async throws -> [Mastodon.Entity.Account.ID] { private func fetchSuggestionAccounts() async throws -> [Mastodon.Entity.Account] {
do { do {
let response = try await context.apiService.suggestionAccountV2( let response = try await context.apiService.suggestionAccountV2(
query: nil, query: nil,
authenticationBox: authContext.mastodonAuthenticationBox authenticationBox: authContext.mastodonAuthenticationBox
) ).value
let userIDs = response.value.map { $0.account.id } return response.compactMap { $0.account }
return userIDs
} catch { } catch {
// fallback V1 // fallback V1
let response = try await context.apiService.suggestionAccount( let response = try await context.apiService.suggestionAccount(
query: nil, query: nil,
authenticationBox: authContext.mastodonAuthenticationBox authenticationBox: authContext.mastodonAuthenticationBox
) ).value
let userIDs = response.value.map { $0.id }
return userIDs return response
} }
} }
} }

View File

@ -6,14 +6,13 @@
// //
import UIKit import UIKit
import CoreDataStack
import MastodonSDK import MastodonSDK
extension ProfileCardTableViewCell { extension ProfileCardTableViewCell {
public func configure( public func configure(
tableView: UITableView, tableView: UITableView,
user: MastodonUser, account: Mastodon.Entity.Account,
profileCardTableViewCellDelegate: ProfileCardTableViewCellDelegate? profileCardTableViewCellDelegate: ProfileCardTableViewCellDelegate?
) { ) {
if profileCardView.frame == .zero { if profileCardView.frame == .zero {
@ -23,7 +22,7 @@ extension ProfileCardTableViewCell {
profileCardView.setupLayoutFrame(layoutMarginsGuide.layoutFrame) profileCardView.setupLayoutFrame(layoutMarginsGuide.layoutFrame)
} }
profileCardView.configure(user: user) profileCardView.configure(account: account)
delegate = profileCardTableViewCellDelegate delegate = profileCardTableViewCellDelegate
} }

View File

@ -7,6 +7,7 @@
import UIKit import UIKit
import Combine import Combine
import MastodonUI
public protocol ProfileCardTableViewCellDelegate: AnyObject { public protocol ProfileCardTableViewCellDelegate: AnyObject {
func profileCardTableViewCell(_ cell: ProfileCardTableViewCell, profileCardView: ProfileCardView, relationshipButtonDidPressed button: ProfileRelationshipActionButton) func profileCardTableViewCell(_ cell: ProfileCardTableViewCell, profileCardView: ProfileCardView, relationshipButtonDidPressed button: ProfileRelationshipActionButton)

View File

@ -15,12 +15,23 @@ import MastodonSDK
extension ProfileCardView { extension ProfileCardView {
public func configure(account: Mastodon.Entity.Account) {
//TODO: Implement
viewModel.authorBannerImageURL = URL(string: account.header)
do {
let content = MastodonContent(content: account.displayNameWithFallback, emojis: account.emojis?.asDictionary ?? [:])
let metaContent = try MastodonMetaContent.convert(document: content)
viewModel.authorName = metaContent
} catch {
assertionFailure(error.localizedDescription)
let metaContent = PlaintextMetaContent(string: account.displayNameWithFallback)
viewModel.authorName = metaContent
}
}
public func configure(user: MastodonUser) { public func configure(user: MastodonUser) {
// banner
user.publisher(for: \.header)
.map { URL(string: $0) }
.assign(to: \.authorBannerImageURL, on: viewModel)
.store(in: &disposeBag)
// author avatar // author avatar
Publishers.CombineLatest3( Publishers.CombineLatest3(
user.publisher(for: \.avatar), user.publisher(for: \.avatar),

View File

@ -14,6 +14,7 @@ import MastodonLocalization
import MastodonAsset import MastodonAsset
import MastodonSDK import MastodonSDK
import MastodonCore import MastodonCore
import MastodonUI
extension ProfileCardView { extension ProfileCardView {
public class ViewModel: ObservableObject { public class ViewModel: ObservableObject {
@ -77,7 +78,7 @@ extension ProfileCardView.ViewModel {
bindRelationship(view: view) bindRelationship(view: view)
bindDashboard(view: view) bindDashboard(view: view)
bindFamiliarFollowers(view: view) bindFamiliarFollowers(view: view)
bindAccessibility(view: view) // bindAccessibility(view: view)
} }
private func bindAppearacne(view: ProfileCardView) { private func bindAppearacne(view: ProfileCardView) {
@ -212,73 +213,73 @@ extension ProfileCardView.ViewModel {
view.familiarFollowersDashboardView.configure(familiarFollowers: familiarFollowers) view.familiarFollowersDashboardView.configure(familiarFollowers: familiarFollowers)
} }
.store(in: &disposeBag) .store(in: &disposeBag)
$backgroundColor // $backgroundColor
.assign(to: \.backgroundColor, on: view.familiarFollowersDashboardView.viewModel) // .assign(to: \.backgroundColor, on: view.familiarFollowersDashboardView.viewModel)
.store(in: &disposeBag) // .store(in: &disposeBag)
} }
private func bindAccessibility(view: ProfileCardView) { // private func bindAccessibility(view: ProfileCardView) {
let authorAccessibilityLabel = Publishers.CombineLatest( // let authorAccessibilityLabel = Publishers.CombineLatest(
$authorName, // $authorName,
$bioContent // $bioContent
) // )
.map { authorName, bioContent -> String? in // .map { authorName, bioContent -> String? in
var strings: [String?] = [] // var strings: [String?] = []
strings.append(authorName?.string) // strings.append(authorName?.string)
strings.append(bioContent?.string) // strings.append(bioContent?.string)
return strings.compactMap { $0 }.joined(separator: ", ") // return strings.compactMap { $0 }.joined(separator: ", ")
} // }
//
authorAccessibilityLabel // authorAccessibilityLabel
.map { $0 ?? "" } // .map { $0 ?? "" }
.assign(to: &$groupedAccessibilityLabel) // .assign(to: &$groupedAccessibilityLabel)
//
$groupedAccessibilityLabel // $groupedAccessibilityLabel
.sink { accessibilityLabel in // .sink { accessibilityLabel in
view.accessibilityLabel = accessibilityLabel // view.accessibilityLabel = accessibilityLabel
} // }
.store(in: &disposeBag) // .store(in: &disposeBag)
//
let statusesContent = $statusesCount // let statusesContent = $statusesCount
.removeDuplicates() // .removeDuplicates()
.map { // .map {
AXCustomContent( // AXCustomContent(
label: L10n.Scene.Profile.Dashboard.otherPosts, // label: L10n.Scene.Profile.Dashboard.otherPosts,
value: $0 // value: "\($0.)"
) // )
} // }
let followingContent = $followingCount // let followingContent = $followingCount
.removeDuplicates() // .removeDuplicates()
.map { // .map {
AXCustomContent( // AXCustomContent(
label: L10n.Scene.Profile.Dashboard.otherFollowing, // label: L10n.Scene.Profile.Dashboard.otherFollowing,
value: $0 // value: $0
) // )
} // }
let followersContent = $followersCount // let followersContent = $followersCount
.removeDuplicates() // .removeDuplicates()
.map { // .map {
AXCustomContent( // AXCustomContent(
label: L10n.Scene.Profile.Dashboard.otherFollowers, // label: L10n.Scene.Profile.Dashboard.otherFollowers,
value: $0 // value: $0
) // )
} // }
let familiarContent = view.familiarFollowersDashboardView.viewModel.$label // let familiarContent = view.familiarFollowersDashboardView.viewModel.$label
.map { $0?.accessibilityLabel } // .map { $0?.accessibilityLabel }
.removeDuplicates() // .removeDuplicates()
.map { // .map {
AXCustomContent( // AXCustomContent(
label: L10n.Scene.Profile.Dashboard.familiarFollowers, // label: L10n.Scene.Profile.Dashboard.familiarFollowers,
value: $0 // value: $0
) // )
} // }
Publishers.CombineLatest4( // Publishers.CombineLatest4(
statusesContent, // statusesContent,
followingContent, // followingContent,
followersContent, // followersContent,
familiarContent // familiarContent
).sink { statuses, following, followers, familiar in // ).sink { statuses, following, followers, familiar in
view.accessibilityCustomContent = [statuses, following, followers, familiar].compactMap { $0 } // view.accessibilityCustomContent = [statuses, following, followers, familiar].compactMap { $0 }
}.store(in: &disposeBag) // }.store(in: &disposeBag)
} // }
} }

View File

@ -9,6 +9,7 @@ import UIKit
import Combine import Combine
import MetaTextKit import MetaTextKit
import MastodonAsset import MastodonAsset
import MastodonUI
public protocol ProfileCardViewDelegate: AnyObject { public protocol ProfileCardViewDelegate: AnyObject {
func profileCardView(_ profileCardView: ProfileCardView, relationshipButtonDidPressed button: ProfileRelationshipActionButton) func profileCardView(_ profileCardView: ProfileCardView, relationshipButtonDidPressed button: ProfileRelationshipActionButton)

View File

@ -1,17 +0,0 @@
//
// CachedProfileViewModel.swift
// Mastodon
//
// Created by MainasuK Cirno on 2021-3-31.
//
import Foundation
import CoreDataStack
import MastodonCore
final class CachedProfileViewModel: ProfileViewModel {
init(context: AppContext, authContext: AuthContext, mastodonUser: MastodonUser) {
super.init(context: context, authContext: authContext, optionalMastodonUser: mastodonUser)
}
}

View File

@ -63,15 +63,3 @@ extension FamiliarFollowersDashboardView {
} }
} }
#if DEBUG
import SwiftUI
struct FamiliarFollowersDashboardView_Preview: PreviewProvider {
static var previews: some View {
UIViewPreview {
FamiliarFollowersDashboardView()
}
}
}
#endif