From 17506f5bd9b54717c6de55241df699b19a8f6371 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Mon, 7 Sep 2020 19:35:28 -0700 Subject: [PATCH] Finalize classes --- .../Sources/ServiceLayer/Utilities/UserDefaultsClient.swift | 2 +- System/AppDelegate.swift | 2 +- View Controllers/StatusListViewController.swift | 2 +- ViewModels/Sources/ViewModels/AddIdentityViewModel.swift | 2 +- ViewModels/Sources/ViewModels/EditFilterViewModel.swift | 2 +- ViewModels/Sources/ViewModels/FiltersViewModel.swift | 2 +- ViewModels/Sources/ViewModels/IdentitiesViewModel.swift | 2 +- ViewModels/Sources/ViewModels/ListsViewModel.swift | 2 +- .../ViewModels/NotificationTypesPreferencesViewModel.swift | 2 +- .../Sources/ViewModels/PostingReadingPreferencesViewModel.swift | 2 +- ViewModels/Sources/ViewModels/PreferencesViewModel.swift | 2 +- ViewModels/Sources/ViewModels/StatusListViewModel.swift | 2 +- ViewModels/Sources/ViewModels/TabNavigationViewModel.swift | 2 +- Views/Attachments/AttachmentView.swift | 2 +- Views/Attachments/AttachmentsView.swift | 2 +- Views/LoadingTableFooterView.swift | 2 +- Views/Status Cell/StatusTableViewCell.swift | 2 +- Views/Status Cell/TouchFallthroughTextView.swift | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ServiceLayer/Sources/ServiceLayer/Utilities/UserDefaultsClient.swift b/ServiceLayer/Sources/ServiceLayer/Utilities/UserDefaultsClient.swift index dbfb977..a94f48f 100644 --- a/ServiceLayer/Sources/ServiceLayer/Utilities/UserDefaultsClient.swift +++ b/ServiceLayer/Sources/ServiceLayer/Utilities/UserDefaultsClient.swift @@ -3,7 +3,7 @@ import CodableBloomFilter import Foundation -class UserDefaultsClient { +final class UserDefaultsClient { private let userDefaults: UserDefaults init(userDefaults: UserDefaults) { diff --git a/System/AppDelegate.swift b/System/AppDelegate.swift index 2e78fea..9198bb7 100644 --- a/System/AppDelegate.swift +++ b/System/AppDelegate.swift @@ -3,7 +3,7 @@ import Combine import UIKit -class AppDelegate: NSObject { +final class AppDelegate: NSObject { @Published private var application: UIApplication? private let remoteNotificationDeviceTokens = PassthroughSubject() } diff --git a/View Controllers/StatusListViewController.swift b/View Controllers/StatusListViewController.swift index 2994bcb..ac5a811 100644 --- a/View Controllers/StatusListViewController.swift +++ b/View Controllers/StatusListViewController.swift @@ -4,7 +4,7 @@ import Combine import SwiftUI import ViewModels -class StatusListViewController: UITableViewController { +final class StatusListViewController: UITableViewController { private let viewModel: StatusListViewModel private let loadingTableFooterView = LoadingTableFooterView() private var cancellables = Set() diff --git a/ViewModels/Sources/ViewModels/AddIdentityViewModel.swift b/ViewModels/Sources/ViewModels/AddIdentityViewModel.swift index 38a2c82..56f9915 100644 --- a/ViewModels/Sources/ViewModels/AddIdentityViewModel.swift +++ b/ViewModels/Sources/ViewModels/AddIdentityViewModel.swift @@ -4,7 +4,7 @@ import Combine import Foundation import ServiceLayer -public class AddIdentityViewModel: ObservableObject { +public final class AddIdentityViewModel: ObservableObject { @Published public var urlFieldText = "" @Published public var alertItem: AlertItem? @Published public private(set) var loading = false diff --git a/ViewModels/Sources/ViewModels/EditFilterViewModel.swift b/ViewModels/Sources/ViewModels/EditFilterViewModel.swift index bfa003d..cb5015d 100644 --- a/ViewModels/Sources/ViewModels/EditFilterViewModel.swift +++ b/ViewModels/Sources/ViewModels/EditFilterViewModel.swift @@ -5,7 +5,7 @@ import Foundation import Mastodon import ServiceLayer -public class EditFilterViewModel: ObservableObject { +public final class EditFilterViewModel: ObservableObject { @Published public var filter: Filter @Published public var saving = false @Published public var alertItem: AlertItem? diff --git a/ViewModels/Sources/ViewModels/FiltersViewModel.swift b/ViewModels/Sources/ViewModels/FiltersViewModel.swift index 8d38dbb..cd1e255 100644 --- a/ViewModels/Sources/ViewModels/FiltersViewModel.swift +++ b/ViewModels/Sources/ViewModels/FiltersViewModel.swift @@ -5,7 +5,7 @@ import Foundation import Mastodon import ServiceLayer -public class FiltersViewModel: ObservableObject { +public final class FiltersViewModel: ObservableObject { @Published public var activeFilters = [Filter]() @Published public var expiredFilters = [Filter]() @Published public var alertItem: AlertItem? diff --git a/ViewModels/Sources/ViewModels/IdentitiesViewModel.swift b/ViewModels/Sources/ViewModels/IdentitiesViewModel.swift index 9135cfe..30ccaa0 100644 --- a/ViewModels/Sources/ViewModels/IdentitiesViewModel.swift +++ b/ViewModels/Sources/ViewModels/IdentitiesViewModel.swift @@ -4,7 +4,7 @@ import Combine import Foundation import ServiceLayer -public class IdentitiesViewModel: ObservableObject { +public final class IdentitiesViewModel: ObservableObject { public let currentIdentityID: UUID @Published public var identities = [Identity]() @Published public var alertItem: AlertItem? diff --git a/ViewModels/Sources/ViewModels/ListsViewModel.swift b/ViewModels/Sources/ViewModels/ListsViewModel.swift index 4f8fd83..a0cd8ac 100644 --- a/ViewModels/Sources/ViewModels/ListsViewModel.swift +++ b/ViewModels/Sources/ViewModels/ListsViewModel.swift @@ -5,7 +5,7 @@ import Foundation import Mastodon import ServiceLayer -public class ListsViewModel: ObservableObject { +public final class ListsViewModel: ObservableObject { @Published public private(set) var lists = [MastodonList]() @Published public private(set) var creatingList = false @Published public var alertItem: AlertItem? diff --git a/ViewModels/Sources/ViewModels/NotificationTypesPreferencesViewModel.swift b/ViewModels/Sources/ViewModels/NotificationTypesPreferencesViewModel.swift index e99a084..8b819cf 100644 --- a/ViewModels/Sources/ViewModels/NotificationTypesPreferencesViewModel.swift +++ b/ViewModels/Sources/ViewModels/NotificationTypesPreferencesViewModel.swift @@ -5,7 +5,7 @@ import Foundation import Mastodon import ServiceLayer -public class NotificationTypesPreferencesViewModel: ObservableObject { +public final class NotificationTypesPreferencesViewModel: ObservableObject { @Published public var pushSubscriptionAlerts: PushSubscription.Alerts @Published public var alertItem: AlertItem? diff --git a/ViewModels/Sources/ViewModels/PostingReadingPreferencesViewModel.swift b/ViewModels/Sources/ViewModels/PostingReadingPreferencesViewModel.swift index 63efe2b..cd4d32a 100644 --- a/ViewModels/Sources/ViewModels/PostingReadingPreferencesViewModel.swift +++ b/ViewModels/Sources/ViewModels/PostingReadingPreferencesViewModel.swift @@ -4,7 +4,7 @@ import Combine import Foundation import ServiceLayer -public class PostingReadingPreferencesViewModel: ObservableObject { +public final class PostingReadingPreferencesViewModel: ObservableObject { @Published public var preferences: Identity.Preferences @Published public var alertItem: AlertItem? diff --git a/ViewModels/Sources/ViewModels/PreferencesViewModel.swift b/ViewModels/Sources/ViewModels/PreferencesViewModel.swift index 3b702d7..2180212 100644 --- a/ViewModels/Sources/ViewModels/PreferencesViewModel.swift +++ b/ViewModels/Sources/ViewModels/PreferencesViewModel.swift @@ -3,7 +3,7 @@ import Foundation import ServiceLayer -public class PreferencesViewModel: ObservableObject { +public final class PreferencesViewModel: ObservableObject { public let handle: String public let shouldShowNotificationTypePreferences: Bool diff --git a/ViewModels/Sources/ViewModels/StatusListViewModel.swift b/ViewModels/Sources/ViewModels/StatusListViewModel.swift index 22f3d37..13d8938 100644 --- a/ViewModels/Sources/ViewModels/StatusListViewModel.swift +++ b/ViewModels/Sources/ViewModels/StatusListViewModel.swift @@ -5,7 +5,7 @@ import Foundation import Mastodon import ServiceLayer -public class StatusListViewModel: ObservableObject { +public final class StatusListViewModel: ObservableObject { @Published public private(set) var statusIDs = [[String]]() @Published public var alertItem: AlertItem? @Published public private(set) var loading = false diff --git a/ViewModels/Sources/ViewModels/TabNavigationViewModel.swift b/ViewModels/Sources/ViewModels/TabNavigationViewModel.swift index 8abb08c..72e7048 100644 --- a/ViewModels/Sources/ViewModels/TabNavigationViewModel.swift +++ b/ViewModels/Sources/ViewModels/TabNavigationViewModel.swift @@ -5,7 +5,7 @@ import Foundation import Mastodon import ServiceLayer -public class TabNavigationViewModel: ObservableObject { +public final class TabNavigationViewModel: ObservableObject { @Published public private(set) var identity: Identity @Published public private(set) var recentIdentities = [Identity]() @Published public var timeline = Timeline.home diff --git a/Views/Attachments/AttachmentView.swift b/Views/Attachments/AttachmentView.swift index 42083d2..33408c7 100644 --- a/Views/Attachments/AttachmentView.swift +++ b/Views/Attachments/AttachmentView.swift @@ -4,7 +4,7 @@ import Kingfisher import UIKit import ViewModels -class AttachmentView: UIView { +final class AttachmentView: UIView { let imageView = AnimatedImageView() let button = UIButton() let viewModel: AttachmentViewModel diff --git a/Views/Attachments/AttachmentsView.swift b/Views/Attachments/AttachmentsView.swift index 7540b00..435ce13 100644 --- a/Views/Attachments/AttachmentsView.swift +++ b/Views/Attachments/AttachmentsView.swift @@ -3,7 +3,7 @@ import UIKit import ViewModels -class AttachmentsView: UIView { +final class AttachmentsView: UIView { private let containerStackView = UIStackView() private let leftStackView = UIStackView() private let rightStackView = UIStackView() diff --git a/Views/LoadingTableFooterView.swift b/Views/LoadingTableFooterView.swift index 7c4575c..5aba9c9 100644 --- a/Views/LoadingTableFooterView.swift +++ b/Views/LoadingTableFooterView.swift @@ -2,7 +2,7 @@ import UIKit -class LoadingTableFooterView: UIView { +final class LoadingTableFooterView: UIView { let activityIndicatorView = UIActivityIndicatorView() override init(frame: CGRect) { diff --git a/Views/Status Cell/StatusTableViewCell.swift b/Views/Status Cell/StatusTableViewCell.swift index 12661c8..d4d6286 100644 --- a/Views/Status Cell/StatusTableViewCell.swift +++ b/Views/Status Cell/StatusTableViewCell.swift @@ -9,7 +9,7 @@ protocol StatusTableViewCellDelegate: class { func statusTableViewCellDidHaveShareButtonTapped(_ cell: StatusTableViewCell) } -class StatusTableViewCell: UITableViewCell { +final class StatusTableViewCell: UITableViewCell { @IBOutlet weak var metaIcon: UIImageView! @IBOutlet weak var metaLabel: UILabel! @IBOutlet weak var contentTextView: TouchFallthroughTextView! diff --git a/Views/Status Cell/TouchFallthroughTextView.swift b/Views/Status Cell/TouchFallthroughTextView.swift index 37a34fa..58948bf 100644 --- a/Views/Status Cell/TouchFallthroughTextView.swift +++ b/Views/Status Cell/TouchFallthroughTextView.swift @@ -2,7 +2,7 @@ import UIKit -class TouchFallthroughTextView: UITextView { +final class TouchFallthroughTextView: UITextView { var shouldFallthrough: Bool = true override init(frame: CGRect, textContainer: NSTextContainer?) {