From 0173c118ae157f84aff0e8a7da59a6094baf6c28 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Sat, 26 Sep 2020 18:44:33 -0700 Subject: [PATCH] Renaming --- Metatext.xcodeproj/project.pbxproj | 16 ++++++------ ...roller.swift => TableViewController.swift} | 8 +++--- Views/CollectionView.swift | 26 ------------------- Views/TabNavigationView.swift | 2 +- Views/TableView.swift | 26 +++++++++++++++++++ 5 files changed, 39 insertions(+), 39 deletions(-) rename View Controllers/{CollectionViewController.swift => TableViewController.swift} (97%) delete mode 100644 Views/CollectionView.swift create mode 100644 Views/TableView.swift diff --git a/Metatext.xcodeproj/project.pbxproj b/Metatext.xcodeproj/project.pbxproj index decc384..fa38afa 100644 --- a/Metatext.xcodeproj/project.pbxproj +++ b/Metatext.xcodeproj/project.pbxproj @@ -31,7 +31,7 @@ D0C7D49724F7616A001EBDBB /* IdentitiesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0C7D42224F76169001EBDBB /* IdentitiesView.swift */; }; D0C7D49824F7616A001EBDBB /* CustomEmojiText.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0C7D42324F76169001EBDBB /* CustomEmojiText.swift */; }; D0C7D49924F7616A001EBDBB /* AddIdentityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0C7D42424F76169001EBDBB /* AddIdentityView.swift */; }; - D0C7D49A24F7616A001EBDBB /* CollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0C7D42524F76169001EBDBB /* CollectionView.swift */; }; + D0C7D49A24F7616A001EBDBB /* TableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0C7D42524F76169001EBDBB /* TableView.swift */; }; D0C7D49B24F7616A001EBDBB /* PreferencesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0C7D42624F76169001EBDBB /* PreferencesView.swift */; }; D0C7D49C24F7616A001EBDBB /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0C7D42724F76169001EBDBB /* RootView.swift */; }; D0C7D49D24F7616A001EBDBB /* PostingReadingPreferencesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0C7D42824F76169001EBDBB /* PostingReadingPreferencesView.swift */; }; @@ -55,7 +55,7 @@ D0F0B10E251A868200942152 /* AccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F0B10D251A868200942152 /* AccountView.swift */; }; D0F0B113251A86A000942152 /* AccountContentConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F0B112251A86A000942152 /* AccountContentConfiguration.swift */; }; D0F0B126251A90F400942152 /* AccountListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F0B125251A90F400942152 /* AccountListCell.swift */; }; - D0F0B12E251A97E400942152 /* CollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F0B12D251A97E400942152 /* CollectionViewController.swift */; }; + D0F0B12E251A97E400942152 /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F0B12D251A97E400942152 /* TableViewController.swift */; }; D0F0B136251AA12700942152 /* CollectionItemKind+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F0B135251AA12700942152 /* CollectionItemKind+Extensions.swift */; }; /* End PBXBuildFile section */ @@ -123,7 +123,7 @@ D0C7D42224F76169001EBDBB /* IdentitiesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IdentitiesView.swift; sourceTree = ""; }; D0C7D42324F76169001EBDBB /* CustomEmojiText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomEmojiText.swift; sourceTree = ""; }; D0C7D42424F76169001EBDBB /* AddIdentityView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddIdentityView.swift; sourceTree = ""; }; - D0C7D42524F76169001EBDBB /* CollectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionView.swift; sourceTree = ""; }; + D0C7D42524F76169001EBDBB /* TableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableView.swift; sourceTree = ""; }; D0C7D42624F76169001EBDBB /* PreferencesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferencesView.swift; sourceTree = ""; }; D0C7D42724F76169001EBDBB /* RootView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = ""; }; D0C7D42824F76169001EBDBB /* PostingReadingPreferencesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostingReadingPreferencesView.swift; sourceTree = ""; }; @@ -151,7 +151,7 @@ D0F0B10D251A868200942152 /* AccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = ""; }; D0F0B112251A86A000942152 /* AccountContentConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountContentConfiguration.swift; sourceTree = ""; }; D0F0B125251A90F400942152 /* AccountListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountListCell.swift; sourceTree = ""; }; - D0F0B12D251A97E400942152 /* CollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionViewController.swift; sourceTree = ""; }; + D0F0B12D251A97E400942152 /* TableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = ""; }; D0F0B135251AA12700942152 /* CollectionItemKind+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CollectionItemKind+Extensions.swift"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -275,7 +275,7 @@ D0F0B10D251A868200942152 /* AccountView.swift */, D0C7D42424F76169001EBDBB /* AddIdentityView.swift */, D01F41E024F8885900D55A2D /* Attachments */, - D0C7D42524F76169001EBDBB /* CollectionView.swift */, + D0C7D42524F76169001EBDBB /* TableView.swift */, D0C7D42324F76169001EBDBB /* CustomEmojiText.swift */, D0BEB21024FA2A90001B0F04 /* EditFilterView.swift */, D0BEB20424FA1107001B0F04 /* FiltersView.swift */, @@ -300,7 +300,7 @@ D0C7D43024F76169001EBDBB /* View Controllers */ = { isa = PBXGroup; children = ( - D0F0B12D251A97E400942152 /* CollectionViewController.swift */, + D0F0B12D251A97E400942152 /* TableViewController.swift */, ); path = "View Controllers"; sourceTree = ""; @@ -525,8 +525,8 @@ D0F0B136251AA12700942152 /* CollectionItemKind+Extensions.swift in Sources */, D0625E5D250F0B5C00502611 /* StatusContentConfiguration.swift in Sources */, D0BEB1F324F8EE8C001B0F04 /* AttachmentView.swift in Sources */, - D0C7D49A24F7616A001EBDBB /* CollectionView.swift in Sources */, - D0F0B12E251A97E400942152 /* CollectionViewController.swift in Sources */, + D0C7D49A24F7616A001EBDBB /* TableView.swift in Sources */, + D0F0B12E251A97E400942152 /* TableViewController.swift in Sources */, D0F0B113251A86A000942152 /* AccountContentConfiguration.swift in Sources */, D01F41D924F880C400D55A2D /* TouchFallthroughTextView.swift in Sources */, D0C7D4D624F7616A001EBDBB /* NSMutableAttributedString+Extensions.swift in Sources */, diff --git a/View Controllers/CollectionViewController.swift b/View Controllers/TableViewController.swift similarity index 97% rename from View Controllers/CollectionViewController.swift rename to View Controllers/TableViewController.swift index 916a29c..082d268 100644 --- a/View Controllers/CollectionViewController.swift +++ b/View Controllers/TableViewController.swift @@ -5,7 +5,7 @@ import SafariServices import SwiftUI import ViewModels -class CollectionViewController: UITableViewController { +class TableViewController: UITableViewController { private let viewModel: CollectionViewModel private let loadingTableFooterView = LoadingTableFooterView() private let webfingerIndicatorView = WebfingerIndicatorView() @@ -111,7 +111,7 @@ class CollectionViewController: UITableViewController { } } -extension CollectionViewController: UITableViewDataSourcePrefetching { +extension TableViewController: UITableViewDataSourcePrefetching { func tableView(_ tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) { guard let maxID = viewModel.nextPageMaxID, @@ -124,7 +124,7 @@ extension CollectionViewController: UITableViewDataSourcePrefetching { } } -private extension CollectionViewController { +private extension TableViewController { func setupViewModelBindings() { viewModel.title.sink { [weak self] in self?.navigationItem.title = $0 }.store(in: &cancellables) @@ -139,7 +139,7 @@ private extension CollectionViewController { case let .share(url): self.share(url: url) case let .collectionNavigation(collectionViewModel): - self.show(CollectionViewController(viewModel: collectionViewModel), sender: self) + self.show(TableViewController(viewModel: collectionViewModel), sender: self) case let .urlNavigation(url): self.present(SFSafariViewController(url: url), animated: true) case .webfingerStart: diff --git a/Views/CollectionView.swift b/Views/CollectionView.swift deleted file mode 100644 index f9b98c5..0000000 --- a/Views/CollectionView.swift +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright © 2020 Metabolist. All rights reserved. - -import SwiftUI -import ViewModels - -struct CollectionView: UIViewControllerRepresentable { - let viewModel: CollectionViewModel - - func makeUIViewController(context: Context) -> CollectionViewController { - CollectionViewController(viewModel: viewModel) - } - - func updateUIViewController(_ uiViewController: CollectionViewController, context: Context) { - - } -} - -#if DEBUG -import PreviewViewModels - -struct StatusListView_Previews: PreviewProvider { - static var previews: some View { - CollectionView(viewModel: NavigationViewModel(identification: .preview).viewModel(timeline: .home)) - } -} -#endif diff --git a/Views/TabNavigationView.swift b/Views/TabNavigationView.swift index 67e1b41..25434a0 100644 --- a/Views/TabNavigationView.swift +++ b/Views/TabNavigationView.swift @@ -61,7 +61,7 @@ private extension TabNavigationView { func view(tab: NavigationViewModel.Tab) -> some View { switch tab { case .timelines: - CollectionView(viewModel: viewModel.viewModel(timeline: viewModel.timeline)) + TableView(viewModel: viewModel.viewModel(timeline: viewModel.timeline)) .id(viewModel.timeline.id) .edgesIgnoringSafeArea(.all) .navigationTitle(viewModel.timeline.title) diff --git a/Views/TableView.swift b/Views/TableView.swift new file mode 100644 index 0000000..6df605d --- /dev/null +++ b/Views/TableView.swift @@ -0,0 +1,26 @@ +// Copyright © 2020 Metabolist. All rights reserved. + +import SwiftUI +import ViewModels + +struct TableView: UIViewControllerRepresentable { + let viewModel: CollectionViewModel + + func makeUIViewController(context: Context) -> TableViewController { + TableViewController(viewModel: viewModel) + } + + func updateUIViewController(_ uiViewController: TableViewController, context: Context) { + + } +} + +#if DEBUG +import PreviewViewModels + +struct StatusListView_Previews: PreviewProvider { + static var previews: some View { + TableView(viewModel: NavigationViewModel(identification: .preview).viewModel(timeline: .home)) + } +} +#endif