Finalize classes

This commit is contained in:
Justin Mazzocchi 2020-11-08 22:22:20 -08:00
parent 095abbeea9
commit a4b94bf33c
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
30 changed files with 31 additions and 31 deletions

View file

@ -3,7 +3,7 @@
import Foundation
import HTTP
public class StubbingURLProtocol: URLProtocol {
public final class StubbingURLProtocol: URLProtocol {
private static var targetsForURLs = [URL: Target]()
private static var stubsForURLs = [URL: HTTPStub]()

View file

@ -39,7 +39,7 @@ private extension HTML {
// https://docs.joinmastodon.org/spec/activitypub/#sanitization
private class HTMLParser: NSObject {
private final class HTMLParser: NSObject {
private struct Link: Hashable {
let href: URL
let location: Int

View file

@ -6,7 +6,7 @@ import Mastodon
import Secrets
import UserNotifications
class NotificationService: UNNotificationServiceExtension {
final class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?

View file

@ -27,7 +27,7 @@ public struct UserNotificationClient {
extension UserNotificationClient {
public static func live(_ userNotificationCenter: UNUserNotificationCenter) -> Self {
// swiftlint:disable nesting
class Delegate: NSObject, UNUserNotificationCenterDelegate {
final class Delegate: NSObject, UNUserNotificationCenterDelegate {
let subject: PassthroughSubject<DelegateEvent, Never>
init(subject: PassthroughSubject<DelegateEvent, Never>) {

View file

@ -42,7 +42,7 @@ extension WebAuthSession {
}
}
class WebAuthSessionContextProvider: NSObject, ASWebAuthenticationPresentationContextProviding {
final class WebAuthSessionContextProvider: NSObject, ASWebAuthenticationPresentationContextProviding {
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
ASPresentationAnchor()
}

View file

@ -2,7 +2,7 @@
import Foundation
public class MockUserDefaults: UserDefaults {
public final class MockUserDefaults: UserDefaults {
public convenience init() {
self.init(suiteName: Self.suiteName)!
}

View file

@ -33,7 +33,7 @@ public class MockWebAuthSession: WebAuthSession {
}
}
public class SuccessfulMockWebAuthSession: MockWebAuthSession {
public final class SuccessfulMockWebAuthSession: MockWebAuthSession {
private let redirectURL: URL
required init(
@ -60,7 +60,7 @@ public class SuccessfulMockWebAuthSession: MockWebAuthSession {
}
}
public class CanceledLoginMockWebAuthSession: MockWebAuthSession {
public final class CanceledLoginMockWebAuthSession: MockWebAuthSession {
override var completionHandlerError: Error? {
WebAuthSessionError(.canceledLogin)
}

View file

@ -6,7 +6,7 @@ import CombineExpectations
@testable import ServiceLayerMocks
import XCTest
class AuthenticationServiceTests: XCTestCase {
final class AuthenticationServiceTests: XCTestCase {
func testAuthentication() throws {
let sut = AuthenticationService(url: URL(string: "https://mastodon.social")!, environment: .mock())
let authenticationRecorder = sut.authenticate().record()

View file

@ -8,7 +8,7 @@ import CombineExpectations
import Stubbing
import XCTest
class InstanceURLServiceTests: XCTestCase {
final class InstanceURLServiceTests: XCTestCase {
func testFiltering() throws {
let sut = InstanceURLService(environment: .mock())

View file

@ -9,7 +9,7 @@ protocol ZoomAnimatorDelegate: class {
func referenceViewFrameInTransitioningView(for zoomAnimator: ZoomAnimator) -> CGRect?
}
class ZoomAnimator: NSObject {
final class ZoomAnimator: NSObject {
weak var fromDelegate: ZoomAnimatorDelegate?
weak var toDelegate: ZoomAnimatorDelegate?

View file

@ -2,7 +2,7 @@
import UIKit
class ZoomDismissalInteractionController: NSObject {
final class ZoomDismissalInteractionController: NSObject {
var transitionContext: UIViewControllerContextTransitioning?
var animator: UIViewControllerAnimatedTransitioning?

View file

@ -2,7 +2,7 @@
import UIKit
class ZoomTransitionController: NSObject {
final class ZoomTransitionController: NSObject {
var isInteractive = false
weak var fromDelegate: ZoomAnimatorDelegate?

View file

@ -3,7 +3,7 @@
import AVFoundation
import UIKit
class ImageNavigationController: UINavigationController {
final class ImageNavigationController: UINavigationController {
let transitionController = ZoomTransitionController()
private let imagePageViewController: ImagePageViewController

View file

@ -3,7 +3,7 @@
import UIKit
import ViewModels
class ImagePageViewController: UIPageViewController {
final class ImagePageViewController: UIPageViewController {
let imageViewControllers: [ImageViewController]
init(initiallyVisible: AttachmentViewModel, statusViewModel: StatusViewModel) {

View file

@ -4,7 +4,7 @@ import Kingfisher
import UIKit
import ViewModels
class ImageViewController: UIViewController {
final class ImageViewController: UIViewController {
let scrollView = UIScrollView()
let imageView = AnimatedImageView()
let playerView = PlayerView()

View file

@ -5,7 +5,7 @@ import Foundation
import Mastodon
import ServiceLayer
final public class CollectionItemsViewModel: ObservableObject {
public final class CollectionItemsViewModel: ObservableObject {
@Published public var alertItem: AlertItem?
public private(set) var nextPageMaxId: String?

View file

@ -3,7 +3,7 @@
import Combine
import ServiceLayer
final public class LoadMoreViewModel: ObservableObject, CollectionItemViewModel {
public final class LoadMoreViewModel: ObservableObject, CollectionItemViewModel {
public var direction = LoadMore.Direction.up
@Published public private(set) var loading = false
public let events: AnyPublisher<AnyPublisher<CollectionItemEvent, Error>, Never>

View file

@ -10,7 +10,7 @@ import ServiceLayerMocks
@testable import ViewModels
import XCTest
class AddIdentityViewModelTests: XCTestCase {
final class AddIdentityViewModelTests: XCTestCase {
func testAddIdentity() throws {
let uuid = UUID(uuidString: "E621E1F8-C36C-495A-93FC-0C247A3E6E5F")!
let environment = AppEnvironment.mock(uuid: { uuid })

View file

@ -7,7 +7,7 @@ import ServiceLayerMocks
@testable import ViewModels
import XCTest
class RootViewModelTests: XCTestCase {
final class RootViewModelTests: XCTestCase {
var cancellables = Set<AnyCancellable>()
func testAddIdentity() throws {

View file

@ -4,7 +4,7 @@ import Kingfisher
import UIKit
import ViewModels
class AccountHeaderView: UIView {
final class AccountHeaderView: UIView {
let headerImageView = AnimatedImageView()
let headerButton = UIButton()
let noteTextView = TouchFallthroughTextView()

View file

@ -3,7 +3,7 @@
import UIKit
import ViewModels
class AccountListCell: UITableViewCell {
final class AccountListCell: UITableViewCell {
var viewModel: AccountViewModel?
override func updateConfiguration(using state: UICellConfigurationState) {

View file

@ -3,7 +3,7 @@
import Kingfisher
import UIKit
class AccountView: UIView {
final class AccountView: UIView {
let avatarImageView = AnimatedImageView()
let displayNameLabel = UILabel()
let accountLabel = UILabel()

View file

@ -3,7 +3,7 @@
import UIKit
import ViewModels
class ConversationListCell: UITableViewCell {
final class ConversationListCell: UITableViewCell {
var viewModel: ConversationViewModel?
override func updateConfiguration(using state: UICellConfigurationState) {

View file

@ -3,7 +3,7 @@
import UIKit
import ViewModels
class LoadMoreCell: UITableViewCell {
final class LoadMoreCell: UITableViewCell {
var viewModel: LoadMoreViewModel?
override func updateConfiguration(using state: UICellConfigurationState) {

View file

@ -3,7 +3,7 @@
import UIKit
import ViewModels
class NotificationListCell: UITableViewCell {
final class NotificationListCell: UITableViewCell {
var viewModel: NotificationViewModel?
override func updateConfiguration(using state: UICellConfigurationState) {

View file

@ -3,7 +3,7 @@
import AVKit
import UIKit
class PlayerView: UIView {
final class PlayerView: UIView {
override class var layerClass: AnyClass {
AVPlayerLayer.self
}

View file

@ -3,7 +3,7 @@
import Mastodon
import UIKit
class PollOptionButton: UIButton {
final class PollOptionButton: UIButton {
init(title: String, emoji: [Emoji], multipleSelection: Bool) {
super.init(frame: .zero)

View file

@ -3,7 +3,7 @@
import Mastodon
import UIKit
class PollResultView: UIView {
final class PollResultView: UIView {
private let verticalStackView = UIStackView()
private let horizontalStackView = UIStackView()
private let titleLabel = UILabel()

View file

@ -3,7 +3,7 @@
import UIKit
import ViewModels
class StatusListCell: UITableViewCell {
final class StatusListCell: UITableViewCell {
var viewModel: StatusViewModel?
override func updateConfiguration(using state: UICellConfigurationState) {

View file

@ -2,7 +2,7 @@
import UIKit
class WebfingerIndicatorView: UIVisualEffectView {
final class WebfingerIndicatorView: UIVisualEffectView {
private let activityIndicatorView = UIActivityIndicatorView()
init() {